@contrast/fn-inspect
TypeScript icon, indicating that this package has built-in type declarations

4.0.0 • Public • Published

@contrast/fn-inspect

Test

This module exposes some useful information from the underlying v8 engine, including:

  • file and line number given a function reference
  • code events (i.e. 'LAZY_COMPILE')

Usage

Getting details about a function:

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

function testFn() {}

const results = funcInfo(testFn);
// => { lineNumber: 2, column: 15, file: 'example.js', method: 'testFn', type: 'Function' }

Registering a listener for code events:

const { setCodeEventListener } = require('@contrast/fn-inspect');

setCodeEventListener((event) => {
  console.log(event);
});

Building locally

npm run build will build the project for your current OS and architecture.

npm run download will pull the most recent build artifacts from GitHub.

Publishing

Simply run npm version and git push && git push --tags. CI will take care of releasing on taggedcommits.

Readme

Keywords

Package Sidebar

Install

npm i @contrast/fn-inspect

Weekly Downloads

599,208

Version

4.0.0

License

MIT

Unpacked Size

1.36 MB

Total Files

32

Last publish

Collaborators

  • planetlevel
  • contrastsec
  • tough-griff
  • annettenugent
  • michaelwitz
  • chrisdunne
  • contrast_admin
  • jcolekaplan
  • bmacnaughton