# iwrap

> A wrapper around Iterable to bring access to powerful methods like `filter`, `map`, etc ...

Latest version **1.0.1** (published 2021-08-12) · MIT license · 0 weekly downloads

## Install

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

## Health

**Score 25/100 (F)** — status: abandoned.

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

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.1 |
| Published | 2021-08-12 |
| First published | 2021-08-10 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 37.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Tristan Guichaoua |
| Maintainers | tguichaoua |
| Keywords | iterable, utility, iterator, generator |

## Links

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

## Alternatives

- [lodash.assign](https://npm.io/package/lodash.assign.md) — 2.3M weekly downloads
- [lodash.chunk](https://npm.io/package/lodash.chunk.md) — 1.8M weekly downloads
- [react-native-ios-utilities](https://npm.io/package/react-native-ios-utilities.md) — 138.5K weekly downloads
- [@technically/lodash](https://npm.io/package/@technically/lodash.md) — 50.9K weekly downloads
- [@fluid-topics/ft-icon](https://npm.io/package/@fluid-topics/ft-icon.md) — 20.6K weekly downloads

## Recent versions

- 1.0.1 (latest) — 2021-08-12
- 0.1.0 — 2021-08-10

## README

<h1 align="center">Iterable Wrapper</h1>
<p align="center">
    <a href="https://www.npmjs.com/package/iwrap" target="_blank">
        <img alt="Version" src="https://img.shields.io/npm/v/iwrap.svg">
    </a>
     <a href="https://github.com/tguichaoua/iwrap/blob/main/LICENSE" target="_blank">
        <img alt="License: MIT" src="https://img.shields.io/github/license/tguichaoua/iwrap" />
    </a>
</p>

> A wrapper around Iterable to bring access to powerful methods like `filter`, `map`, etc ...

## Install

Install by running this command:

```sh
npm i iwrap
```

## How to use

```ts
import { IWrap } from "iwrap";

const scores = new Map([
    ["Alice", 500],
    ["Bob", 356],
    ["Charles", 42],
    ["David", 999],
]);

// Output wanted:
// Alice.........................500
// Bob...........................356
// Charles.......................42
// David.........................999

// Without IWrap
const display1 = Array.from(scores) //from: scores is iterated and a array is created.
    // map: previous array is iterated and a new array is created.
    .map(([name, score]) => `${name}${".".repeat(30 - name.length)}${score}`)
    // join: previous array is iterated and return a string.
    .join("\n");
// Result: 3 iterations
console.log(display1);

// With IWrap
const display2 = IWrap.from(scores) // from: creates a wrapper around scores.
    // map: a new wrapper is created around the prevous one.
    .map(([name, score]) => `${name}${".".repeat(30 - name.length)}${score}`)
    // join: iterate the previous wrapper and return a string.
    .join("\n");
// Result: 1 iteration
console.log(display2);
```

## Author

👤 **Tristan Guichaoua**

-   Github: [@tguichaoua](https://github.com/tguichaoua)

## 📝 License

Copyright © 2021 [Tristan Guichaoua](https://github.com/tguichaoua).<br />
This project is [MIT](https://github.com/tguichaoua/iwrap/blob/main/LICENSE) licensed.

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