Big update!Introducing GitHub Bot Commands. Learn more
Socket
Log inBook a demo

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
38,433,401
decreased by-0.65%

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 33,403,684 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 because the last version was released a year ago.It has 2 open source maintainers collaborating on the project.

Last updated on 17 May 2016

Did you know?

Socket installs a Github app to automatically flag issues on every pull request and report the health of your dependencies. Find out what is inside your node modules and prevent malicious activity before you update the dependencies.

Install Socket
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