# every

> an event emitter for integer-based millisecond steps

Latest version **0.0.1** (published 2013-02-19) · MIT license · 0 weekly downloads

## Install

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

## 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.0.1 |
| Published | 2013-02-19 |
| First published | 2013-02-19 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Chris Dickinson |
| Maintainers | chrisdickinson |
| Keywords | timer, setInterval, events |

## Links

- npm: https://www.npmjs.com/package/every
- Repository: https://github.com/chrisdickinson/every
- npm.io page: https://npm.io/package/every

## Alternatives

- [async-exit-hook](https://npm.io/package/async-exit-hook.md) — 3.7M weekly downloads
- [evnty](https://npm.io/package/evnty.md) — 7.2K weekly downloads
- [eleventy-plugin-asciidoc](https://npm.io/package/eleventy-plugin-asciidoc.md) — 3.5K weekly downloads
- [@jswork/next-get2get](https://npm.io/package/@jswork/next-get2get.md) — 945 weekly downloads
- [@dashersw/axon](https://npm.io/package/@dashersw/axon.md) — 934 weekly downloads

## Recent versions

- 0.0.1 (latest) — 2013-02-19

## README

# every

an event emitter for integer-based millisecond
steps.

```javascript

var every = require('every')

every(33)
  .on('data', function(dt) {
    console.log(dt) // will always be a multiple of 33  
  })

```

## api

#### timer = every(ms[, installTimer, uninstallTimer, now])

create an event emitter that emits every `ms`. 

optionally provide your own install / uninstall functions for timers.

install functions are expected to return a handle which will then be given to the
uninstall function when the timer is destroyed.

you may also provide your own `now` function -- it defaults to `Date.now()`.

#### timer.paused() -> Boolean

returns whether or not the timer is paused.

#### timer.pause()

pauses the timer. the timer will not emit events while paused.

#### timer.resume()

resumes the timer. the timer will start emitting events again.
**it will not emit the difference between `pause` and `resume` on the next step.**

#### timer.rate() -> currentRateMS

emit the current rate in milliseconds.

#### timer.rate(rate) -> currentRateMS

set the current rate in milliseconds.

#### timer.destroy()

uninstalls the timer function.

## license

MIT

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