Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

caller-path

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

caller-path - npm Package Compare versions

Comparing version 0.1.0 to 1.0.0

4

index.js
'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 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc