# @contrast/fn-inspect

> Retrieve function name and line number from a function reference

Latest version **5.0.2** (published 2025-07-30) · MIT license · 0 weekly downloads

## Install

```sh
npm install @contrast/fn-inspect
pnpm add @contrast/fn-inspect
yarn add @contrast/fn-inspect
bun add @contrast/fn-inspect
```

## Health

**Score 35/100 (D)** — status: maintenance-mode.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: stale; low maintenance score.

## Facts

| | |
|---|---|
| Version | 5.0.2 |
| Published | 2025-07-30 |
| First published | 2020-04-30 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Node | >=18.7.0 |
| Dependencies | 3 |
| Unpacked size | 912.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | yes |
| Author | Contrast Security |
| Maintainers | tough-griff, michaelwitz, chrisdunne, contrast_admin, jcolekaplan, bmacnaughton, contrastsec, planetlevel, mhenry-contrast |
| Keywords | instrumentation |

## Links

- npm: https://www.npmjs.com/package/@contrast/fn-inspect
- Repository: https://github.com/Contrast-Security-Inc/node-fn-inspect
- Homepage: https://github.com/Contrast-Security-Inc/node-fn-inspect#readme
- Issues: https://github.com/Contrast-Security-Inc/node-fn-inspect/issues
- npm.io page: https://npm.io/package/@contrast/fn-inspect

## Dependencies (3)

- [nan](https://npm.io/package/nan.md) ^2.23.0
- [node-abi](https://npm.io/package/node-abi.md) ^4.12.0
- [node-gyp-build](https://npm.io/package/node-gyp-build.md) ^4.8.1

## Recent versions

- 5.0.2 (latest) — 2025-07-30
- 5.0.1 — 2025-07-30
- 5.0.0 — 2025-07-29
- 4.3.0 — 2024-07-23
- 4.2.0 — 2024-06-06
- 4.1.0 — 2024-05-17
- 4.0.0 — 2023-12-20
- 3.4.0 — 2023-08-29
- 3.3.1 — 2023-04-26
- 3.3.0 — 2022-11-30
- 3.2.0 — 2022-08-26
- 3.1.0 — 2022-06-28
- 3.1.0-beta.1 — 2022-06-23
- 3.0.0 — 2022-06-17
- 2.4.7 — 2022-03-28
- … 17 more at https://npm.io/package/@contrast/fn-inspect/versions

## README

# @contrast/fn-inspect

[![Test](https://github.com/Contrast-Security-Inc/node-fn-inspect/actions/workflows/test.yml/badge.svg)](https://github.com/Contrast-Security-Inc/node-fn-inspect/actions/workflows/test.yml)

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

- file and line number given a function reference

## Usage

Getting details about a function:

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

function testFn() {}

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

## 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 then invoke the `release` workflow. You can run
`release` using the github UI or, if you have the github CLI installed, you
can run `gh workflow run release.yml` (also available via `npm run release`).

Note that `upload-artifacts@v4` no longer works when there are multiple
artifacts with the same name. That's why the `release` workflow has the
following section:

```
  uses: actions/upload-artifact@v4
  with:
    name: prebuilds-${{ matrix.build-group }}
    path: prebuilds/
```

---
_Source: https://npm.io/package/@contrast/fn-inspect · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
