Socket
Book a DemoInstallSign in
Socket

co-map

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

co-map

Map a co generator stream with a functions

latest
npmnpm
Version
1.1.0
Version published
Maintainers
1
Created
Source

co-map

Map a co generator stream over a function.

build status

Usage

var read = map(stream(), function*(data, i){
  return i + ': ' + data;
});

var data;
while (data = yield read()) console.log(data);

API

map(read, fn)

Call fn with each value read yields, plus its iteration index, and yield the return value.

A falsy return yields skips a value and doesn't end the stream.

read can also be an Array.

Installation

$ npm install co-map

License

MIT

FAQs

Package last updated on 09 Feb 2014

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts