# heapsnapshot.js

> A tool to take a heap snapshot of Node.js via V8 profiler

Latest version **1.1.1** (published 2018-10-11) · MIT license · 0 weekly downloads

## Install

```sh
npm install heapsnapshot.js
pnpm add heapsnapshot.js
yarn add heapsnapshot.js
bun add heapsnapshot.js
```

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.1 |
| Published | 2018-10-11 |
| First published | 2018-10-11 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 4.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | flyingpig princetotti@163.com |
| Maintainers | flyinpig |
| Keywords | js, gc, nodejs, heap, memory, v8, snapshot |

## Links

- npm: https://www.npmjs.com/package/heapsnapshot.js
- Repository: https://github.com/hzzhujf/heapsnapshot.js
- Homepage: https://github.com/hzzhujf/heapsnapshot.js#readme
- Issues: https://github.com/hzzhujf/heapsnapshot.js/issues
- npm.io page: https://npm.io/package/heapsnapshot.js

## Dependencies (1)

- [v8-profiler-node8](https://npm.io/package/v8-profiler-node8.md) ^6.0.1

## Alternatives

- [@mapbox/jsonlint-lines-primitives](https://npm.io/package/@mapbox/jsonlint-lines-primitives.md) — 5.3M weekly downloads
- [reftools](https://npm.io/package/reftools.md) — 3.5M weekly downloads
- [@hey-api/openapi-ts](https://npm.io/package/@hey-api/openapi-ts.md) — 3.5M weekly downloads
- [@mapbox/geojson-rewind](https://npm.io/package/@mapbox/geojson-rewind.md) — 2.4M weekly downloads
- [turbo-stream](https://npm.io/package/turbo-stream.md) — 1.7M weekly downloads

## Recent versions

- 1.1.1 (latest) — 2018-10-11
- 1.0.1 — 2018-10-11
- 0.0.1 — 2018-10-11

## README

![npm](https://img.shields.io/npm/dw/heapsnapshot.js.svg)
![GitHub](https://img.shields.io/github/license/mashape/apistatus.svg)

# heapdump.js
A tool to take a heap snapshot via V8 profiler, which is inspired by [Understanding Garbage Collection and hunting Memory Leaks in Node.js](https://www.dynatrace.com/news/blog/understanding-garbage-collection-and-hunting-memory-leaks-in-node-js/)

## required
- Node.js >= 6.4.0
- OSX: This code is only pass-test on OSX platform

## install
```shell
npm install heapsnapshot.js
```

## usage
add this code to the start
```javascript
require('heapsnapshot.js').init()
```
heapsnapshot.init([dataDir][,options])
- `dataDir` <string>  the path of folder for heap snapshot file. *Default*:`.`
- `options` <object>
  - `interval`  <number>  the interval millisecond to check the usage of memory. *Default*:`500`
  - `step`: <number>  the distance between two adjacent threshold. *Default*:`50`
  - `threshold`: <number> the initial threshold.  *Default*:`0`

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