Skip to content

assign require in node, instead of global #2

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: node
Choose a base branch
from

Conversation

dominictarr
Copy link
Contributor

in node.js you must assign the return value of the require statement.

var Semper = require('./semper')

That was all.

This is a huge win in node.js because we totally escape dependency hell.
Each module is wrapped in a closure, and then assigned to a variable where it is used,

I wrote a blog post about the strengths of node's module system here

http://dominictarr.com/post/25516279897/why-you-should-never-write-a-package-manager

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants