New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

@gulujs/caller-path

Package Overview
Dependencies
Maintainers
0
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@gulujs/caller-path

Get the file path of the caller function

latest
Source
npmnpm
Version
0.3.0
Version published
Maintainers
0
Created
Source

@gulujs/caller-path

Get the path of the caller function

Installation

npm install @gulujs/caller-path

Usage

  • Example 1
// main.js
const { callerPath } = require('@gulujs/cller-path');
function main() {
  console.log(callerPath());
}
main(); // => /full/path/to/main.js
  • Example 2
// foo.js
const { callerPath } = require('@gulujs/cller-path');
function foo() {
  console.log(callerPath({ shift: 1 }))
}
module.exports = {
  foo
};
// bar.js
const { foo } = require('./foo');
foo(); // => /full/path/to/bar.js

API

callerPath(options?)

  • shift
    • Type: number
    • Default: 0
  • excludeFileNames
    • Type: Array<string|RegExp>
    • Default: undefined
  • excludeFunctionNames
    • Type: Array<string|RegExp>
    • Default: undefined
  • debug
    • Type: boolean
    • Default: false

License

MIT

Keywords

caller

FAQs

Package last updated on 04 Aug 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts