safecb

0.0.1 • Public • Published

safecb

var safe = require('safecb')
 
function doStuff (cb) {
  cb = safe(cb)
  // prevent these typical problems:
  cb() // synchronous invocation
  cb() // multiple invocations
  cb() // undefined is not a function (if cb is undefined)
}

Package Sidebar

Install

npm i safecb

Weekly Downloads

8

Version

0.0.1

License

MIT

Last publish

Collaborators

  • spwilko
  • genevayngrib
  • pgmemk
  • tenaciousmv