# filter-iterable

> iterable decorated with filter method

Latest version **0.1.5** (published 2018-02-09) · MIT license · 0 weekly downloads

## Install

```sh
npm install filter-iterable
pnpm add filter-iterable
yarn add filter-iterable
bun add filter-iterable
```

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.5 |
| Published | 2018-02-09 |
| First published | 2017-08-14 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Unpacked size | 11.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Xavier Garcia Buils |
| Maintainers | xgbuils |
| Keywords | iterable, lazy, slice |

## Links

- npm: https://www.npmjs.com/package/filter-iterable
- Repository: https://github.com/xgbuils/filter-iterable
- Homepage: https://github.com/xgbuils/filter-iterable#readme
- Issues: https://github.com/xgbuils/filter-iterable/issues
- npm.io page: https://npm.io/package/filter-iterable

## Dependencies (3)

- [immutable-array.of](https://npm.io/package/immutable-array.of.md) ^0.1.0
- [immutable-array.push](https://npm.io/package/immutable-array.push.md) ^0.1.0
- [immutable-array.every](https://npm.io/package/immutable-array.every.md) ^0.1.0

## Recent versions

- 0.1.5 (latest) — 2018-02-09
- 0.1.4 — 2018-02-01
- 0.1.3 — 2017-08-14

## README

# filter-iterable

[![travis ci][1]][2]
[![npm version][3]][4]
[![Coverage Status][5]][6]
[![Dependency Status][7]][8]

`filter-iterable` exports a class that builds iterables that provide filter method.

## Install

``` bash
$ npm install filter-iterable --save
```

## Usage
``` javascript
const FilterIterable = require('filter-iterable')

const iterable = new FilterIterable(new Set([4, 2, 7, 8, 4, 7])) // (4 2 7 8 4 7)
    .filter(e => e % 2 === 0) // (4 2 8 4)
    .filter(e => e !== 8) // (4 2 4)

// converting to array:
[...iterable] // [4 2 4]

// traversing values:
for (const val of iterable) {
    // ...
}

// creating an iterator that traverses the values
let iterator = iterable[Symbol.iterator]()
iterator.next() // {value: 4, done: false}
iterator.next() // {value: 2, done: false}
iterator.next() // {value: 4, done: false}
iterator.next() // {value: undefined, done: true}

// Infinite iterable
const naturals = {
    [Symbol.iterator]: function* () {
        let i = 1
        while(true) { yield i++ }
    }
} // (1 2 3 4...)

new FilterIterable(naturals) // (1 2 3 4 5 6 7 8 9...)
    .filter(e => e % 2 === 0) // (2 4 6 8 10...)
```

## Support
- Node.js >=6
- ES2015 transpilers

## License
MIT

  [1]: https://travis-ci.org/xgbuils/filter-iterable.svg?branch=master
  [2]: https://travis-ci.org/xgbuils/filter-iterable
  [3]: https://badge.fury.io/js/filter-iterable.svg
  [4]: https://badge.fury.io/js/filter-iterable
  [5]: https://coveralls.io/repos/github/xgbuils/filter-iterable/badge.svg?branch=master
  [6]: https://coveralls.io/github/xgbuils/filter-iterable?branch=master
  [7]: https://david-dm.org/xgbuils/filter-iterable.svg
  [8]: https://david-dm.org/xgbuils/filter-iterable

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