@f/map-gen

Map for generator.

Stats

StarsIssuesVersionUpdatedCreatedSize
@f/map-gen
121.6.06 years ago6 years agoMinified + gzip package size for @f/map-gen in KB

Readme

map-gen

Build status Git tag NPM version Code style

Map for generator.

Installation

$ npm install @f/map-gen

Usage

var map = require('@f/map-gen')

Array.from(map(addOne, function * () {
  yield 1
  yield 2
  yield 3
})) // [2, 3, 4]

function addOne(v) {
  return v + 1
}

API

mapGen(fn, gen)

  • fn - mapping function
  • gen - generates values to map

Returns: generator of mapped values

License

MIT

If you find any bugs or have a feature request, please open an issue on github!

The npm package download data comes from npm's download counts api and package details come from npms.io.