Skip to content
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

differentiate between core cluster and this module with require() #198

Open
ORESoftware opened this issue Apr 4, 2017 · 2 comments
Open

Comments

@ORESoftware
Copy link

ORESoftware commented Apr 4, 2017

I opened this issue with Node.js help

nodejs/help#562 (comment)

in my testing, if I just call require('cluster') the Node.js core module will get loaded, whether I install this module as a package.json devDependency or a regular dependency

I am wondering how I can reliably load this module instead of the core module, and vice versa. Any insight or help would be of help thanks!

@bnoordhuis
Copy link

You can always load it with require('./node_modules/cluster').

@ORESoftware
Copy link
Author

ORESoftware commented Apr 5, 2017

@bnoordhuis yeah thanks, good call, I didn't realize how old this project was, I remember now that it became part of core so the userland module was abandoned.

As mentioned on the Node.js help thread, you can also require a userland module with the same name as a core module by adding a slash like so:

require('cluster/');

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

No branches or pull requests

3 participants
@bnoordhuis @ORESoftware and others