# fps-collector

> collect fps containing css3 animation information;collect fps when scrolling

Latest version **0.3.0** (published 2018-03-06) · MIT license · 0 weekly downloads

## Install

```sh
npm install fps-collector
pnpm add fps-collector
yarn add fps-collector
bun add fps-collector
```

## 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.3.0 |
| Published | 2018-03-06 |
| First published | 2018-01-10 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >= 8.0.0 |
| Dependencies | 1 |
| Unpacked size | 388.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | whale |
| Maintainers | whale-you |

## Links

- npm: https://www.npmjs.com/package/fps-collector
- Repository: https://github.com/Youjingyu/fps-collector
- Homepage: https://github.com/Youjingyu/fps-collector#readme
- Issues: https://github.com/Youjingyu/fps-collector/issues
- npm.io page: https://npm.io/package/fps-collector

## Dependencies (1)

- [collect-fps](https://npm.io/package/collect-fps.md) ^2.0.0

## Recent versions

- 0.3.0 (latest) — 2018-03-06
- 0.2.2 — 2018-03-04
- 0.2.1 — 2018-01-11
- 0.2.0 — 2018-01-11
- 0.1.0 — 2018-01-10

## README

# fps-collector
collect fps containing css3 animation information;collect fps when scrolling fast
## usage
```bash
npm i fps-collector --save
```
and then, collect fps in a period of time
```javascript
import { collectAnimationFps } from 'fps-collector';

const collector = new collectAnimationFps({
  duration: 5000 // keep collecting for 5000ms after collector.start()
});
// start collecting
collector.start();
// collect ended after 5000ms
collector.on('end', data => {
  // return fps containing css3 animation information in 5000ms
  console.log(data);
});
// you can also stop early
collector.stop(data => {
  console.log(data);
});
```
or collect fps when scrolling fast
```javascript
import { collectScrollFps } from 'fps-collector';

const scrollCollector = new collectScrollFps({
  threshold: 2 // it is considered as a fast scrolling when scrolling 2 screens in one second
});
// start collecting
scrollCollector.start();
// get fps after each fast scrolling
scrollCollector.on('end', data => {
  console.log(data);
});
// stop collecting
scrollCollector.stop()
```

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