node-resolve
Locate modules using the Node resolution algorithm, for using third party modules in node_modules.
v1.3.x breaking change, you have to pass a 'cwd' to resolve, '.' is default.
var nodeResolve = require('node-resolve');
nodeResolve.resolve('src/index.js', './foo/foo', '.');
nodeResolve.resolve('src/index.js', 'babel-core', '.');
undefined
is returned if not found, and null
is returned if it's a builtin module(fs,path...).
node-resolve supports browser spec.
nodeResolve.resolve('src/index.js', 'inherits', '.', true)
nodeResolve.resolve('src/index.js', 'fs', '.', true)