I have one file which defines a single "default" function, and I want to import it in other:
HelloLog.js:
exports.default = (str) => {
console.log(`Hello, logging ${str}!`);
}
Client.js:
const HelloLog = require('./HelloLog');
HelloLog.default("foobar"); // do not want
// I'd rather just do this:
HelloLog("foobar")
The fact is I get an error if I do it like in the second call above.
Question is: how should I change HelloLog.js so that second option on file Client.js would work?