# requestanimationframe-timer

> setTimeout and setInterval by using requestAnimationFrame

Latest version **3.0.3** (published 2020-01-08) · ISC license · 0 weekly downloads

## Install

```sh
npm install requestanimationframe-timer
pnpm add requestanimationframe-timer
yarn add requestanimationframe-timer
bun add requestanimationframe-timer
```

## Health

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

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 3.0.3 |
| Published | 2020-01-08 |
| First published | 2018-01-03 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Node | >= 10.18 |
| Dependencies | 1 |
| Unpacked size | 19.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Chua Kang Ming |
| Maintainers | kambing86 |
| Keywords | clearInterval, clearTimeout, requestAnimationFrame, setInterval, setTimeout |

## Links

- npm: https://www.npmjs.com/package/requestanimationframe-timer
- Repository: https://github.com/kambing86/requestanimationframe-timer
- Homepage: https://github.com/kambing86/requestanimationframe-timer#readme
- Issues: https://github.com/kambing86/requestanimationframe-timer/issues
- npm.io page: https://npm.io/package/requestanimationframe-timer

## Dependencies (1)

- [raf](https://npm.io/package/raf.md) ^3.4.1

## Alternatives

- [@luma.gl/experimental](https://npm.io/package/@luma.gl/experimental.md) — 77.1K weekly downloads
- [persona-harness](https://npm.io/package/persona-harness.md) — 4.7K weekly downloads
- [@tsparticles/effect-bubble](https://npm.io/package/@tsparticles/effect-bubble.md) — 4.6K weekly downloads
- [f3d](https://npm.io/package/f3d.md) — 730 weekly downloads
- [spark-html-motion](https://npm.io/package/spark-html-motion.md) — 298 weekly downloads

## Recent versions

- 3.0.3 (latest) — 2020-01-08
- 3.0.2 — 2020-01-08
- 3.0.0 — 2020-01-08
- 2.0.0 — 2019-12-30
- 1.0.5 — 2019-09-19
- 1.0.4 — 2018-01-04
- 1.0.3 — 2018-01-04
- 1.0.2 — 2018-01-03
- 1.0.1 — 2018-01-03
- 1.0.0 — 2018-01-03

## README

<!-- [![npm][npm]][npm-url]
[![deps][deps]][deps-url]
[![test][test]][test-url]
[![coverage][cover]][cover-url]
[![chat][chat]][chat-url] -->

<div align="center">
  <!-- replace with accurate logo e.g from https://worldvectorlogo.com/ -->
  <img width="200" height="200" src="https://cdn.worldvectorlogo.com/logos/javascript.svg">
  <a href="https://webpack.js.org/">
    <img width="200" height="200" vspace="" hspace="25" src="https://cdn.rawgit.com/webpack/media/e7485eb2/logo/icon-square-big.svg">
  </a>
  <h1>requestanimationframe-timer</h1>
  <p>setTimeout and setInterval by using requestAnimationFrame</p>
</div>

<h2 align="center">Install</h2>

```bash
npm install --save-dev requestanimationframe-timer
```

<h2 align="center">Usage</h2>

```js
import { setInterval, setTimeout, clearInterval, clearTimeout } from 'requestanimationframe-timer';

const id_1 = setTimeout((a) => console.log(a), 1000, '1000 ms timeout');
const id_2 = setInterval((a) => console.log(a), 2000, '2000 ms interval');
setTimeout(() => {
  clearTimeout(id_1);
  clearInterval(id_2);
}, 10000);
```

<h2 align="center">Maintainers</h2>

<table>
  <tbody>
    <tr>
      <td align="center">
        <a href="https://github.com/kambing86">
          <img width="150" height="150" src="https://avatars3.githubusercontent.com/u/1342133?s=460&v=4">
          </br>
          Chua Kang Ming
        </a>
      </td>
    </tr>
  <tbody>
</table>

<!-- [npm]: https://img.shields.io/npm/v/requestanimationframe-timer.svg
[npm-url]: https://npmjs.com/package/requestanimationframe-timer

[deps]: https://david-dm.org/webpack-contrib/requestanimationframe-timer.svg
[deps-url]: https://david-dm.org/webpack-contrib/requestanimationframe-timer

[chat]: https://img.shields.io/badge/gitter-webpack%2Fwebpack-brightgreen.svg
[chat-url]: https://gitter.im/webpack/webpack

[test]: http://img.shields.io/travis/webpack-contrib/requestanimationframe-timer.svg
[test-url]: https://travis-ci.org/webpack-contrib/requestanimationframe-timer

[cover]: https://codecov.io/gh/webpack-contrib/requestanimationframe-timer/branch/master/graph/badge.svg
[cover-url]: https://codecov.io/gh/webpack-contrib/requestanimationframe-timer -->

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