# stats-js

> JavaScript Performance Monitor

Latest version **1.0.1** (published 2019-04-24) · MIT license · 0 weekly downloads

## Install

```sh
npm install stats-js
pnpm add stats-js
yarn add stats-js
bun add stats-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.0.1 |
| Published | 2019-04-24 |
| First published | 2014-10-04 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 12.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 26 |
| Author | Kevin Isom |
| Maintainers | kev_nz |
| Keywords | stats, webgl |

## Links

- npm: https://www.npmjs.com/package/stats-js
- Repository: https://github.com/Kevnz/stats.js
- Issues: https://github.com/Kevnz/stats.js/issues
- npm.io page: https://npm.io/package/stats-js

## Recent versions

- 1.0.1 (latest) — 2019-04-24
- 1.0.0 — 2018-12-14
- 1.0.0-alpha1 — 2014-10-04

## README

stats.js
========

#### JavaScript Performance Monitor ####

This class provides a simple info box that will help you monitor your code performance.

* **FPS** Frames rendered in the last second. The higher the number the better.
* **MS** Milliseconds needed to render a frame. The lower the number the better.
* **MB** MBytes of allocated memory. (Run Chrome with `--enable-precise-memory-info`)
* **CUSTOM** User-defined panel support.


### Screenshots ###

![fps.png](https://raw.githubusercontent.com/Kevnz/stats.js/master/files/fps.png)
![ms.png](https://raw.githubusercontent.com/Kevnz/stats.js/master/files/ms.png)
![mb.png](https://raw.githubusercontent.com/Kevnz/stats.js/master/files/mb.png)
![custom.png](https://raw.githubusercontent.com/Kevnz/stats.js/master/files/custom.png)


### Usage ###

```javascript
var stats = new Stats();
stats.showPanel( 1 ); // 0: fps, 1: ms, 2: mb, 3+: custom
document.body.appendChild( stats.dom );

function animate() {

	stats.begin();

	// monitored code goes here

	stats.end();

	requestAnimationFrame( animate );

}

requestAnimationFrame( animate );
```


### Bookmarklet ###

You can add this code to any page using the following bookmarklet:

```javascript
javascript:(function(){var script=document.createElement('script');script.onload=function(){var stats=new Stats();document.body.appendChild(stats.dom);requestAnimationFrame(function loop(){stats.update();requestAnimationFrame(loop)});};script.src='//cdn.jsdelivr.net/gh/Kevnz/stats.js/build/stats.min.js';document.head.appendChild(script);})()
```

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