# iterpal

> iterable tools

Latest version **0.4.0** (published 2024-03-27) · MIT license · 0 weekly downloads

## Install

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

## Health

**Score 40/100 (D)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads; pre 1.0.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 0.4.0 |
| Published | 2024-03-27 |
| First published | 2019-05-07 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | >=18.0.0 |
| Dependencies | 0 |
| Unpacked size | 215.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Evan Hahn |
| Maintainers | evanhahn |
| Keywords | iterator, iterable, generator, stream |

## Links

- npm: https://www.npmjs.com/package/iterpal
- Repository: https://github.com/EvanHahn/iterpal
- Issues: https://github.com/EvanHahn/iterpal/issues
- npm.io page: https://npm.io/package/iterpal

## Alternatives

- [byte-size](https://npm.io/package/byte-size.md) — 2.1M weekly downloads
- [speed-limiter](https://npm.io/package/speed-limiter.md) — 16.0K weekly downloads
- [@powersync/node](https://npm.io/package/@powersync/node.md) — 10.9K weekly downloads
- [@ledgerhq/coin-cardano](https://npm.io/package/@ledgerhq/coin-cardano.md) — 1.0K weekly downloads
- [@jayesol/jayeson.lib.streamfinder](https://npm.io/package/@jayesol/jayeson.lib.streamfinder.md) — 1.0K weekly downloads

## Recent versions

- 0.4.0 (latest) — 2024-03-27
- 0.3.0 — 2024-02-27
- 0.2.0 — 2019-05-27
- 0.1.0 — 2019-05-07

## README

# Iterpal

Iterable tools for JavaScript.

## Installation

Iterpal is available from the npm registry:

```sh
npm install iterpal
```

With Deno:

```typescript
import { filter, map } from "https://evanhahn.com/tape/iterpal/0.3.0/mod.ts";
```

## Documentation

[API documentation](https://doc.deno.land/https://evanhahn.com/tape/iterpal/0.3.0/mod.ts)

## Use cases

- Get helpful utilities not in the standard library.

  `last` is a simple one, but there are many others:

  ```javascript
  import { last } from "iterpal";
  last("iterpal!");
  // => "!"
  ```

- Use collection utilities like `map` and `filter` with any iterable.

  That includes arrays, strings,
  [sets](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set),
  [maps](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map),
  [typed arrays](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray),
  [buffers](https://nodejs.org/api/buffer.html#buffer_buffer),
  [streams](https://nodejs.org/api/stream.html), (async)
  [generators](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Generator),
  or
  [anything implementing the interface](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols#The_iterable_protocol).

  ```javascript
  import { filter } from "iterpal";
  const letterOs = filter("foo", (c) => c === "o");
  ```

- Take advantage of lazy iteration.

  Many of Iterpal's functions return lazily, which can help you maintain a
  functional style while still enjoying performance benefits.

  ```javascript
  import { map, take } from "iterpal";

  // The second operation is faster because
  // it iterates over fewer values.
  lotsOfNumbers.map(square).slice(10);
  lotsOfNumbers.slice(10).map(square);

  // These two operations are basically equivalent.
  take(map(lotsOfNumbers, square), 10);
  map(take(lotsOfNumbers, 10), square);
  ```

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