1 min readSep 21, 2019
In Node.js module system, when you export it as module.export
it will be the default one. In latest JavaScript andTypeScript syntax, it will be equivalent to export default
.
Even if I made the function as default, it does not have to be anonymous function. I can name the function for better debugging purpose. Once I name the function like this, module.export = function foo(db, keyword)
. The function name foo
will be appear in call stack.