0.2.3 • Published 10 years ago

wrappers v0.2.3

Weekly downloads
14
License
MIT
Repository
github
Last release
10 years ago

Wrappers

npm status build status dependency status coverage status

Wrappers is a small library exporting basic wrapper functions for functions.

Usage

Attach it to the short variable of choice:

var w = require('wrappers');

then get some cheap extra funcitonality out of your functions with standard wrappers:

var safeInit = w.once(init); // invokes wrapped init function at most once
var tracedFn = w.trace(buggyFn); // logs input and output when called
var rateLimited = w.throttle(cpuHeavyFn, 200); // triggers at most every 200ms
var burstTrigger = w.repeat(w.repeat(fire, 5, 50), 3, 1000); // bursts of 5 every second 3 times

Read the API.

This module used to be included in functional utility library interlude, but is now an extra.

Installation

$ npm install wrappers

License

MIT-Licensed. See LICENSE file for details.

0.2.3

10 years ago

0.2.2

11 years ago

0.2.1

13 years ago

0.2.0

13 years ago

0.1.0

13 years ago

0.0.2

13 years ago

0.0.1

13 years ago