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

Already on GitHub? Sign in to your account

More robust check for running under node #10

Merged
merged 1 commit into from Nov 21, 2012

Conversation

Projects
None yet
2 participants
Contributor

gmethvin commented Nov 16, 2012

Check if module.exports exists, since this is a more reliable check if
we are running under node. Checking for window conflicts with some
node modules like d3 that define a global window object.

More robust check for running under node
Check if module.exports exists, since this is a more reliable check if
we are running under node. Checking for window conflicts with some
node modules like d3 that define a global window object.
Contributor

gmethvin commented Nov 17, 2012

Fixes #7.

@alexgorbatchev I know this will still not work correctly if module.exports is defined on the browser, but I think that's far less likely than window being defined in node. I've seen many other modules use a similar strategy for detecting node.

alexgorbatchev added a commit that referenced this pull request Nov 21, 2012

Merge pull request #10 from gmethvin/master
More robust check for running under node

@alexgorbatchev alexgorbatchev merged commit 3f931f9 into alexgorbatchev:master Nov 21, 2012

Owner

alexgorbatchev commented Nov 21, 2012

Thank you very much for contributing!

alexgorbatchev added a commit that referenced this pull request May 5, 2015

Merge pull request #10 from gmethvin/master
More robust check for running under node
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment