require-resolve
Use the node way to resolve required path to absolute path.
The node way
Install
$ npm install --save require-resolve
Usage
var requireResolve = require('../'),
path = require('path');
console.log(requireResolve(__filename));
console.log(requireResolve('./example/simple.js', path.dirname(path.dirname(__filename))));
console.log(requireResolve('glup', __filename));
console.log(requireResolve('glup/taskTree', __filename));
Contributing
In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using gulp.
License
Copyright (c) 2015 Zhonglei Qiu. Licensed under the MIT license.