I have a library and I want to test it by doing a full install locally before publishing to npm. One of the things I want to test is if all the dependencies are part of the project. Because of how nodejs structures its module system though, (a nodejs module is searched for at every directory level) I do not have a good way to ensure that the module I am requiring came from the current folder's node_modules, and not the parent folder's node_modules.
Here is the project structure:
library-folder/
package.json
node_modules/
testing/integration/
package.json
node_modules/
test-install.js
I want to know if there is a way to tell nodejs to only require modules from the current directory, and ignore any parent directories.