safecb

v0.0.1
normalize callback arguments
callback once dezalgo safe

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)
}
npm i safecb

Metadata

  • MIT
  • Whatever
  • Mark Vayngrib
  • released 6/9/2015

Downloads

Maintainers