Skip to content

lazy evaluate array processing, do only what you need

Notifications You must be signed in to change notification settings

coderaiser/lazymap

Repository files navigation

Lazymap License NPM version Dependency Status Build Status Coverage Status

Lazy evaluate array processing, do only what you need.

Install

npm i lazymap -S

Example

const lazy = require('lazy');
const squad = require('squad');

const fn = squad.apply(...[
    a => `hello ${a}`,
    a => String(a),
    a => ++a,
    a => a * a
]);

const take = lazy(fn, [1, 2, 3, 4, 5]);

take(2);
// returns
[ 'hello 2', 'hello 5']

Environments

Node.js

In old node.js environments that supports es5 only, lazymap could be used with:

var lazymap = require('lazymap/legacy');

Web Browser

lazymap could be installed via bower with:

bower install lazymap --save

When loaded in browser lazymap uses global variable with same name (when browserify or webpack did not used).

License

MIT

About

lazy evaluate array processing, do only what you need

Resources

Stars

Watchers

Forks

Packages

No packages published