# delay-repeater

> Run a function repeatly with a delay

Latest version **1.0.2** (published 2018-09-22) · MIT license · 0 weekly downloads

## Install

```sh
npm install delay-repeater
pnpm add delay-repeater
yarn add delay-repeater
bun add delay-repeater
```

## 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.2 |
| Published | 2018-09-22 |
| First published | 2016-11-21 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 4.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | xavierchow |
| Maintainers | xavierchow |

## Links

- npm: https://www.npmjs.com/package/delay-repeater
- npm.io page: https://npm.io/package/delay-repeater

## Recent versions

- 1.0.2 (latest) — 2018-09-22
- 1.0.1 — 2016-11-21
- 1.0.0 — 2016-11-21

## README

# Run your code repeatly with a delay

# Install
```
npm install delay-repeater
```

# Usage
```js
//es6 module
import repeat from 'delay-repeater';
//or CommonJS require style
const repeat = require('delay-repeater').default;

const fn = () => {
  console.log('ipsum');
}
const times = 3;
const interval = 3000; // 3 seconds
repeat(fn, times, interval);

//or with an error first callback
const done = (e) => {
  if (e) {
    return console.log(e);
  }
  console.log('3 times execution finished');
}
repeat(fn, times, interval, done);
```

**Note** If the `fn` returns a Promise, the delay will be after the Promise resolved, this is easy to run some asynchrous codes(e.g. http request or IO) repeatly.

# License
MIT

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