LearnBoost / cluster

Node.JS multi-core server manager with plugins support.
http://learnboost.github.com/cluster
MIT License
2.29k stars 159 forks source link

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

Open ORESoftware opened 7 years ago

ORESoftware commented 7 years ago

I opened this issue with Node.js help

https://github.com/nodejs/help/issues/562#issuecomment-291654323

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 commented 7 years ago

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

ORESoftware commented 7 years ago

@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/');