Big update!Announcing Socket for GitHub 1.0. Learn more
Socket
BlogLoveFAQ
Install
Log in

wrappy

Package Overview
Dependencies
0
Maintainers
2
Versions
4
Issues
File Explorer

Advanced tools

wrappy

Callback wrapping utility

    1.0.2latest

Version published
Maintainers
2
Weekly downloads
39,956,423
increased by0.08%

Weekly downloads

Readme

Source

wrappy

Callback wrapping utility

USAGE

var wrappy = require("wrappy") // var wrapper = wrappy(wrapperFunction) // make sure a cb is called only once // See also: http://npm.im/once for this specific use case var once = wrappy(function (cb) { var called = false return function () { if (called) return called = true return cb.apply(this, arguments) } }) function printBoo () { console.log('boo') } // has some rando property printBoo.iAmBooPrinter = true var onlyPrintOnce = once(printBoo) onlyPrintOnce() // prints 'boo' onlyPrintOnce() // does nothing // random property is retained! assert.equal(onlyPrintOnce.iAmBooPrinter, true)

FAQs

What is wrappy?

Callback wrapping utility

Is wrappy popular?

The npm package wrappy receives a total of 32,860,432 weekly downloads. As such, wrappy popularity was classified as popular.

Is wrappy well maintained?

We found that wrappy demonstrated a not healthy version release cadence and project activity. It has 2 open source maintainers collaborating on the project.

Last updated on 17 May 2016
Socket

Product

Subscribe to our newsletter

Get open source security insights delivered straight into your inbox. Be the first to learn about new features and product updates.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc