# increlation

> An incremenentor that is limited to a minimum and maximum value, but allows reusing a value once resolved.

Latest version **2.0.1** (published 2021-09-15) · MIT license · 0 weekly downloads

## Install

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

## 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 | 2.0.1 |
| Published | 2021-09-15 |
| First published | 2021-09-12 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 7.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Mark Wylde |
| Maintainers | markwylde |
| Keywords | incrementor, correllation-id, iterator |

## Links

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

## Alternatives

- [@sindresorhus/slugify](https://npm.io/package/@sindresorhus/slugify.md) — 3.7M weekly downloads
- [solid-js](https://npm.io/package/solid-js.md) — 2.7M weekly downloads
- [expo-glass-effect](https://npm.io/package/expo-glass-effect.md) — 2.5M weekly downloads
- [nanoassert](https://npm.io/package/nanoassert.md) — 780.8K weekly downloads
- [@ffmpeg/ffmpeg](https://npm.io/package/@ffmpeg/ffmpeg.md) — 529.5K weekly downloads

## Recent versions

- 2.0.1 (latest) — 2021-09-15
- 2.0.0 — 2021-09-15
- 1.0.1 — 2021-09-12
- 1.0.0 — 2021-09-12

## README

# Increlation
An incremenentor that is limited to a minimum and maximum value, but allows reusing a value once resolved.

## Install
```javascript
npm install --save increlation
```

## Usage
### Sync
increlation.sync (minimum, maximum)

```javascript
const increlation = require('increlation');

const incrementor = increlation.sync(1, 10);

incrementor.next() // === { done: false, value: 1 }
incrementor.next() // === { done: false, value: 2 }
///...
incrementor.next() // === { done: false, value: 10 }
incrementor.release(5)
incrementor.next() // === { done: false, value: 5 }
incrementor.next() // === { done: true, value: null }
```

### Async
increlation.async (minimum, maximum, timeout = Infinity)

```javascript
const increlation = require('increlation');

const incrementor = increlation.async(1, 10, 1000);

await incrementor.next() // === { done: false, value: 1 }
await incrementor.next() // === { done: false, value: 2 }
///...
await incrementor.next() // === { done: false, value: 10 }
incrementor.next().then(result => {
  result // === { done: false, value: 5 }
})
incrementor.release(5)
```

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