# cpuprofile

> A simple representation of .cpuprofile files.

Latest version **0.1.1** (published 2016-11-21) · MIT license · 0 weekly downloads

## Install

```sh
npm install cpuprofile
pnpm add cpuprofile
yarn add cpuprofile
bun add cpuprofile
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.1 |
| Published | 2016-11-21 |
| First published | 2016-11-18 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Sebastian Ruhleder |
| Maintainers | ruhleder |
| Keywords | cpuprofile, profile |

## Links

- npm: https://www.npmjs.com/package/cpuprofile
- Repository: https://github.com/ruhleder/cpuprofile
- Issues: https://github.com/ruhleder/cpuprofile/issues
- npm.io page: https://npm.io/package/cpuprofile

## Recent versions

- 0.1.1 (latest) — 2016-11-21
- 0.1.0 — 2016-11-18

## README

# cpuprofile

A simple representation of .cpuprofile files.

## Installation

```
npm install --save cpuprofile
```

## Usage

```javascript
const Profile = require('cpuprofile').Profile;

// read and parse a .cpuprofile file
let content = require('fs').readFileSync('prof.cpuprofile', {encoding: 'utf8'});
let parsed = JSON.parse(content);

// create Profile
let profile = Profile.createFromObject(parsed);

// generate formatted overview on self and total times
let output = profile.formattedBottomUpProfile();
```

## Features

- `Profile` and `ProfileNode` classes.
- Generation of Bottom Up Profiling view of Chrome DevTools.

## Credits

- [Alexei Filippov](mailto:alph@chromium.org): Thanks for pointing me in the right direction!
- [Chromium](https://chromium.googlesource.com/): The calculation of self and total times is adapted from parts of the Chromium project.

## License

Copyright &copy; 2016 by Sebastian Ruhleder. Released under the MIT license.

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