Ohm-Management - Projektarbeit B-ME
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

readme.md 726B

123456789101112131415161718192021222324252627282930313233343536
  1. # caller-path [![Build Status](https://travis-ci.org/sindresorhus/caller-path.svg?branch=master)](https://travis-ci.org/sindresorhus/caller-path)
  2. > Get the path of the caller module
  3. You can't use [`module.parent`](http://nodejs.org/api/modules.html#modules_module_parent) as modules are cached and it will return the first caller module, not necessarily the current one.
  4. ## Install
  5. ```
  6. $ npm install --save caller-path
  7. ```
  8. ## Usage
  9. ```js
  10. // foo.js
  11. var callerPath = require('caller-path');
  12. module.exports = function () {
  13. console.log(callerPath());
  14. //=> /Users/sindresorhus/dev/unicorn/bar.js
  15. }
  16. ```
  17. ```js
  18. // bar.js
  19. var foo = require('./foo');
  20. foo();
  21. ```
  22. ## License
  23. MIT © [Sindre Sorhus](http://sindresorhus.com)