Skip to content

assign require in node, instead of global#2

Open
dominictarr wants to merge 1 commit intocjheath:nodefrom
dominictarr:node
Open

assign require in node, instead of global#2
dominictarr wants to merge 1 commit intocjheath:nodefrom
dominictarr:node

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