Callback wrapping utility
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)Selectively mirror the npm registry inside your firewall. Filter packages based on security, licensing, code quality and more. Build awesome stuff faster. Try npm Enterprise for free…
None
None
react-native-ok-sdk, pb-schema, zyl, yss-perseus, npmc, fhir2, once-debug, aaaaaserver, h5-templete, hendo-cli, wedmaster, wc-starterkit, npm, kountexample, nguye, cordova-plugin-amplify-payment, inflight, panqibao, @rstacruz/pnpm, jmpr-jpm, salty, dezalgo, strict-once, tang-union-find, yapm, react-flux-router-boilerplate, async-once, cbify, callback-tracker, npm-for-cnpm, ecor, npm-msys2, omegapm, naver-npm, npm-2, web-component-tester-bundle, cordova-plugin-mobile-explorer, smart-code, unzip-sync, cordova-plugin-amplify-pay, uinz-notification, tanngo, once, wed_developer, strongloop, sabers, customer-service, xtzx, primeng-custom, server-liuxinru, and more