Created
January 12, 2018 09:24
-
-
Save ogiermaitre/b1f745a1f07f13927b58700155f73d89 to your computer and use it in GitHub Desktop.
[Modules dev tricks] #node #javascript #es6
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const __main__ = () => { | |
| } | |
| const __module__ = () => { | |
| module.exports = {} | |
| } | |
| if (!module.parent) { | |
| __main__() | |
| } else { | |
| __module__() | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment