# stats.ts

> JavaScript Performance Monitor

Latest version **2.1.6** (published 2026-02-21) · MIT license · 0 weekly downloads

## Install

```sh
npm install stats.ts
pnpm add stats.ts
yarn add stats.ts
bun add stats.ts
```

## Health

**Score 65/100 (B)** — status: stable.

Positive: has types; esm support; no vulnerabilities; has provenance; high maintenance score.

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 2.1.6 |
| Published | 2026-02-21 |
| First published | 2020-11-11 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 347.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| GitHub stars | 7 |
| Author | matteobruni |
| Maintainers | ar3s, matteobruni |
| Keywords | performance, fps, stats |

## Links

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

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 2.1.6 (latest) — 2026-02-21
- 2.1.5 — 2026-02-20
- 2.0.0 — 2026-02-20
- 1.1.0 — 2020-11-16
- 1.0.0 — 2020-11-11

## README

stats.ts
========

#### 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/matteobruni/stats.ts/main/files/fps.png)
![ms.png](https://raw.githubusercontent.com/matteobruni/stats.ts/main/files/ms.png)
![mb.png](https://raw.githubusercontent.com/matteobruni/stats.ts/main/files/mb.png)
![custom.png](https://raw.githubusercontent.com/matteobruni/stats.ts/main/files/custom.png)

### Installation ###
```bash
npm install stats.ts
```

### 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='https://cdn.jsdelivr.net/npm/stats.ts';document.head.appendChild(script);})()
```

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