1.0.1 • Published 7 years ago

lazymap v1.0.1

Weekly downloads
1
License
MIT
Repository
github
Last release
7 years ago

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

1.0.1

7 years ago

1.0.0

8 years ago