I'm creating a unit converter, and I want to put all of the conversion functions into their own file. Using ES6 export
, is there any way to export all of the functions in the file with their default names using only one line? For example:
export default all;
The functions are all just in the file, not within an object.
export default { fn1(), fn2(), ... }
, or wrapping them inside aclass
thenexport default MyClass
. One other solution is to putexport
in front of every functions andimport * as MyConverter from './myconverter.js'
– Toothsome