FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

nextcloud.com/node_modules/caller-path at master · nextcloud/nextcloud.com · GitHub

This repository was archived by the owner on Oct 19, 2022. It is now read-only.
/ nextcloud.com Public archive

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

readme.md

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


Back | FazBrowse Home | New Git URL