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

get-function-location

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

get-function-location

Retrieve the source location of a function in Node 8+.

  • 2.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
8.8K
decreased by-1.59%
Maintainers
1
Weekly downloads
 
Created
Source

get-function-location

A utility function that provides access to a given function's source location.

Install

$ npm install get-function-location

Usage

const getFunctionLocation = require('get-function-location');

function someFunction() {};

let result = await getFunctionLocation(someFunction);

// => { source: 'file:///Users/rjackson/src/rwjblue/get-function-location/this-file.js', line: 3, column: 22 }

Compatibility

This package relies on functionality added in Node 8 to gather function location information. When using in older Node versions, getFunctionLocation will return a promise that resolves to null.

License

MIT © Robert Jackson

FAQs

Package last updated on 28 Nov 2018

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

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