3.1.0 • Published 3 days ago

it-map v3.1.0

Weekly downloads
18,165
License
Apache-2.0 OR MIT
Repository
github
Last release
3 days ago

it-map

codecov CI

Maps the values yielded by an async iterator

About

Convert one value from an (async)iterator into another.

Example

import map from 'it-map'

// This can also be an iterator, generator, etc
const values = [0, 1, 2, 3, 4]

const result = map(values, (val, index) => val++)

console.info(result) // [1, 2, 3, 4, 5]

Async sources and transforms must be awaited:

import map from 'it-map'

const values = async function * () {
  yield * [0, 1, 2, 3, 4]
}

const result = await map(values(), async (val, index) => val++)

console.info(result) // [1, 2, 3, 4, 5]

Install

$ npm i it-map

Browser <script> tag

Loading this module through a script tag will make it's exports available as ItMap in the global namespace.

<script src="https://unpkg.com/it-map/dist/index.min.js"></script>

API Docs

License

Licensed under either of

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

3.1.0

3 days ago

3.0.6

3 days ago

3.0.5

5 months ago

3.0.4

9 months ago

3.0.3

12 months ago

3.0.2

1 year ago

3.0.1

1 year ago

3.0.0

1 year ago

2.0.1

1 year ago

2.0.0

2 years ago

1.0.6

3 years ago

1.0.5

3 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago