Ensure to resolve the path of a NPM dependency. Similar to force-require but return the path of the dependency instead.
npm install force-resolve --save
var forceResolve = require('force-resolve');
// [
// '/Users/kikobeats/Projects/force-resolve/node_modules/mocha',
// '/usr/local/lib/node_modules/mocha'
// ]
Try to load a dependency based in the name. If cb
is provided then the call will be resolved as sync interface.
MIT © Kiko Beats