I want to export all methods of a file from another file.
currently I am doing this, and it works. How can I merge below two into 1 export expression
imp
How can I merge below two into 1 export expression
You cannot.
ES2015 (and ES2016) does not provide a syntax that would allow you to import all the named exports from a file and export the object (with those as its properties) as default in a single statement.
You cannot in ES2016. To create a module namespace object, you need to give it an identifier (like db
) in your current module scope, and then re-export that. There's no way around it.
There is however a stage 1 proposal to add the export * as default from …
syntax you were trying.