Socket
Socket
Sign inDemoInstall

caller-path

Package Overview
Dependencies
2
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.0.0 to 2.0.0

license

6

index.js
'use strict';
var callerCallsite = require('caller-callsite');
const callerCallsite = require('caller-callsite');
module.exports = function () {
return callerCallsite().getFileName();
};
module.exports = () => callerCallsite().getFileName();
{
"name": "caller-path",
"version": "1.0.0",
"version": "2.0.0",
"description": "Get the path of the caller function",

@@ -13,6 +13,6 @@ "license": "MIT",

"engines": {
"node": ">=0.10.0"
"node": ">=4"
},
"scripts": {
"test": "node test.js"
"test": "xo && ava"
},

@@ -37,7 +37,11 @@ "files": [

"dependencies": {
"caller-callsite": "^1.0.0"
"caller-callsite": "^2.0.0"
},
"devDependencies": {
"ava": "0.0.4"
"ava": "*",
"xo": "*"
},
"xo": {
"esnext": true
}
}

@@ -17,7 +17,7 @@ # caller-path [![Build Status](https://travis-ci.org/sindresorhus/caller-path.svg?branch=master)](https://travis-ci.org/sindresorhus/caller-path)

// foo.js
var callerPath = require('caller-path');
const callerPath = require('caller-path');
module.exports = function () {
module.exports = () => {
console.log(callerPath());
//=> /Users/sindresorhus/dev/unicorn/bar.js
//=> '/Users/sindresorhus/dev/unicorn/bar.js'
}

@@ -28,3 +28,3 @@ ```

// bar.js
var foo = require('./foo');
const foo = require('./foo');
foo();

@@ -36,2 +36,2 @@ ```

MIT © [Sindre Sorhus](http://sindresorhus.com)
MIT © [Sindre Sorhus](https://sindresorhus.com)
SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc