Wednesday 24 May 2017

module.exports best practices?

I'm having trouble determining the difference (if any) between these three expressions. It seems to me that they would all achieve the same end result. If so, which is the "standard" or largely preferred format and why?// exporting a function with nested functions module.exports = () => { foo() { } bar() { } } // exporting an object literal module.exports = { foo : () => {}, bar: () => {} } // export expression with named parameter module.exports.foo = () => { } module.exports.baz = () => { }

Submitted May 24, 2017 at 03:42PM by Midicide

No comments:

Post a Comment