package
Maps the values yielded by an async iterator
npm install it-mapGitHub-flavored package documentation.
Across all versions.
Download trend unavailable.
Runtime metadata.
Maps the values yielded by an async iterator
Convert one value from an (async)iterator into another.
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]$ npm i it-map<script> tagLoading this module through a script tag will make its exports available as ItMap in the global namespace.
<script src="https://unpkg.com/it-map/dist/index.min.js"></script>Licensed under either of
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.
Estimated unpacked size across 2 packages.
37.7 kB
Includes dependencies.