Let's say I have a javascript module first_file.js
:
var first = "first",
second = "second",
third = "third";
module.exports = {first, second, third};
How do I import these into another file in one line? The following only imports third
:
var first, second, third = require('./path/to/first_file.js');
You could store them in an array:
module.exports = [first, second, third];
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With