# @amphibian/iterate

> functional while loop abstraction to return iterators on an increment

Latest version **2.0.1** (published 2016-12-14) · ISC license · 0 weekly downloads

## Install

```sh
npm install @amphibian/iterate
pnpm add @amphibian/iterate
yarn add @amphibian/iterate
bun add @amphibian/iterate
```

## 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 | 2016-12-14 |
| First published | 2015-10-21 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Thomas Lindstrøm |
| Maintainers | amphibian |

## Links

- npm: https://www.npmjs.com/package/@amphibian/iterate
- Repository: https://gitlab.com/thomaslindstr_m/iterate
- Homepage: https://gitlab.com/thomaslindstr_m/iterate#README
- Issues: https://gitlab.com/thomaslindstr_m/iterate/issues
- npm.io page: https://npm.io/package/@amphibian/iterate

## Recent versions

- 2.0.1 (latest) — 2016-12-14
- 2.0.0 — 2016-10-13
- 1.0.9 — 2016-09-08
- 1.0.8 — 2015-11-22
- 1.0.7 — 2015-11-02
- 1.0.6 — 2015-10-21
- 1.0.5 — 2015-10-21
- 1.0.4 — 2015-10-21
- 1.0.3 — 2015-10-21
- 1.0.2 — 2015-10-21

## README

# iterate

[![build status](https://gitlab.com/thomaslindstr_m/iterate/badges/master/build.svg)](https://gitlab.com/thomaslindstr_m/iterate/commits/master)

functional while loop abstraction to return iterators on an increment

```
npm install @amphibian/iterate
```

```javascript
var iterate = require('@amphibian/iterate');

// Iterate 5 times from 0
var iterateUp = iterate(+1);

iterateUp(5, function (i) {
    console.log(i); // 0, 1, 2, 3, 4
});

// Iterate on even numbers from 0 to 5
var iterateEven = iterate(+2);

iterateEven(5, function (i) {
    console.log(i); // 0, 2, 4
});

// Iterate towards 0 from 5, but end at 3
var iterateDown = iterate(-1);
var greeting = iterateDown(5, function (i, end) {
    console.log(i);

    if (i === 3) {
        end('hola que tal');
    }
});

console.log(greeting); // > hola que tal
```

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