# perioda

> Periodical task runner

Latest version **1.1.0** (published 2021-05-03) · MIT license · 0 weekly downloads

## Install

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

## 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.1.0 |
| Published | 2021-05-03 |
| First published | 2016-12-12 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 6.5 KB |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 0 |
| Author | David Jelić |
| Maintainers | djelich |
| Keywords | periodical, task, runner, setTimeout, interval |

## Links

- npm: https://www.npmjs.com/package/perioda
- Repository: https://github.com/djelic/perioda
- Homepage: https://github.com/djelic/perioda#readme
- Issues: https://github.com/djelic/perioda/issues
- npm.io page: https://npm.io/package/perioda

## Dependencies (1)

- [parse-duration](https://npm.io/package/parse-duration.md) ^1.0.0

## Recent versions

- 1.1.0 (latest) — 2021-05-03
- 1.0.1 — 2016-12-12
- 1.0.0 — 2016-12-12

## README

# perioda
Periodical task runner for Node.js with support for callbacks and promises.

## Install
```
npm install perioda --save
```

## Usage
```js
const perioda = require('perioda')

const fn = function (cb) {
  console.log('running task')
  process.nextTick(cb)
}

// or return Promise

const fn = function () {
  return new Promise((resolve, reject) => {
    // do something
    resolve()
  })
}

const task = perioda(fn, 1000).start()

task.on('error', (err) => {
  console.log('processing error: %s', err.message)
  task.stop()
})

task.on('result', (resutl) => {
  console.log('task result: %j', result)
})
```

## Test
```
npm test
```

## Licence
MIT

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