Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

safecb

mvayngrib34MIT0.0.1

normalize callback arguments

callback, once, dezalgo, safe

readme

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)
}