caller-path
Advanced tools
Comparing version 0.1.0 to 1.0.0
'use strict'; | ||
var callsites = require('callsites'); | ||
var callerCallsite = require('caller-callsite'); | ||
module.exports = function () { | ||
return callsites()[2].getFileName(); | ||
return callerCallsite().getFileName(); | ||
}; |
{ | ||
"name": "caller-path", | ||
"version": "0.1.0", | ||
"description": "Get the path of the caller module", | ||
"version": "1.0.0", | ||
"description": "Get the path of the caller function", | ||
"license": "MIT", | ||
@@ -10,3 +10,3 @@ "repository": "sindresorhus/caller-path", | ||
"email": "sindresorhus@gmail.com", | ||
"url": "http://sindresorhus.com" | ||
"url": "sindresorhus.com" | ||
}, | ||
@@ -17,3 +17,3 @@ "engines": { | ||
"scripts": { | ||
"test": "mocha" | ||
"test": "node test.js" | ||
}, | ||
@@ -38,7 +38,7 @@ "files": [ | ||
"dependencies": { | ||
"callsites": "^0.2.0" | ||
"caller-callsite": "^1.0.0" | ||
}, | ||
"devDependencies": { | ||
"mocha": "*" | ||
"ava": "0.0.4" | ||
} | ||
} |
# caller-path [![Build Status](https://travis-ci.org/sindresorhus/caller-path.svg?branch=master)](https://travis-ci.org/sindresorhus/caller-path) | ||
> Get the path of the caller module | ||
> Get the path of the caller function | ||
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. | ||
## Install | ||
@@ -9,0 +7,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
1
1384
35
+ Addedcaller-callsite@^1.0.0
+ Addedcaller-callsite@1.0.1(transitive)
+ Addedcallsites@1.0.1(transitive)
- Removedcallsites@^0.2.0
- Removedcallsites@0.2.0(transitive)