# v8-inspect-profiler

> v8 profiling via the chrome dev-tools protocol

Latest version **0.1.1** (published 2024-04-02) · MIT license · 0 weekly downloads

## Install

```sh
npm install v8-inspect-profiler
pnpm add v8-inspect-profiler
yarn add v8-inspect-profiler
bun add v8-inspect-profiler
```

## Health

**Score 20/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities.

Warnings: low downloads; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.1 |
| Published | 2024-04-02 |
| First published | 2017-11-22 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 6.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 21 |
| Author | jrieken |
| Maintainers | jrieken |

## Links

- npm: https://www.npmjs.com/package/v8-inspect-profiler
- Repository: https://github.com/jrieken/v8-inspect-profiler
- Homepage: https://github.com/jrieken/v8-inspect-profiler#readme
- Issues: https://github.com/jrieken/v8-inspect-profiler/issues
- npm.io page: https://npm.io/package/v8-inspect-profiler

## Dependencies (1)

- [chrome-remote-interface](https://npm.io/package/chrome-remote-interface.md) ^0.33.0

## Recent versions

- 0.1.1 (latest) — 2024-04-02
- 0.1.0 — 2022-01-04
- 0.0.22 — 2021-07-02
- 0.0.21 — 2020-12-03
- 0.0.20 — 2018-12-17
- 0.0.19 — 2018-12-17
- 0.0.18 — 2018-12-13
- 0.0.15 — 2018-12-13
- 0.0.14 — 2018-12-13
- 0.0.13 — 2018-11-12
- 0.0.12 — 2018-11-12
- 0.0.11 — 2018-11-12
- 0.0.10 — 2018-11-12
- 0.0.9 — 2018-11-12
- 0.0.8 — 2018-01-11
- … 6 more at https://npm.io/package/v8-inspect-profiler/versions

## README

### V8 Inspect Profiler

This node module offers v8 cpu profiling via the [Chrome DevTools protocol](https://chromedevtools.github.io/devtools-protocol/v8/Profiler/). 


### Usage


Start the node.js instance that you want to profile

```
node --inspect-brk=5222 myApp.js
```

Next, start profiling. Create an app that starts and stops profiling. Like so: 

```js
const profiler = require('v8-inspect-profiler');

// connect and start profiler
const session = await profiler.startProfiling({port: 5222 });

// time goes by ...

// stop profiler and disconnect 
const profile = await session.stop();

// save profile to disk
await profiler.writeProfile(profile, 'somepath.cpuprofile');
```

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