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

@contrast/fn-inspect

Package Overview
Dependencies
Maintainers
18
Versions
29
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@contrast/fn-inspect

Retrieve function name and line number from a function reference

  • 1.0.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
527K
decreased by-18.92%
Maintainers
18
Weekly downloads
 
Created
Source

@contrast/fn-inspect

This module uses some v8 function APIs to obtain the file and line number of a function reference. It will also return the constructor's name and function name.

Installation

npm install @contrast/fn-inspect

Usage

  const funcInfo = require('@contrast/fn-inspect');

  function testFunction() {}

  const results = funcInfo(testFunction);

  // Returns an object with the following data
  // { lineNumber: 2, file: 'example.js', method: 'testFunction', type: 'Function' }

Build locally

npm install

Test

npm test

License

Copyright 2020-present OpenJS Foundation and contributors. Licensed MIT.

Keywords

FAQs

Package last updated on 30 Apr 2020

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