Give require some options
Download node at nodejs.org and install it, if you haven't already.
npm install graceful-require --save
Demo. Rename node_modules
to vendor
.
$ ls
index.js node_modules package.json
$ mv node_modules vendor
then, you can require any directory name you liked
require = require('graceful-require')('vendor');
var table = require('text-table');
var t = table([
[ 'master', '0123456789abcdef' ],
[ 'staging', 'fedcba9876543210' ]
]);
console.log(t);
npm install
npm test