mirror of
https://github.com/nodejs/node.git
synced 2026-11-24 21:50:36 -05:00
ESLint 2.9.0 fixes some minor bugs that we have been experiencing and introduces some new rules that we may wish to consider. PR-URL: https://github.com/nodejs/node/pull/6498 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Roman Reiss <me@silverwind.io>
caller-path 
Get the path of the caller module
You can't use module.parent as modules are cached and it will return the first caller module, not necessarily the current one.
Install
$ npm install --save caller-path
Usage
// foo.js
var callerPath = require('caller-path');
module.exports = function () {
console.log(callerPath());
//=> /Users/sindresorhus/dev/unicorn/bar.js
}
// bar.js
var foo = require('./foo');
foo();
License
MIT © Sindre Sorhus