/ stream.nieuweinstituut.nl / node_modules / call-me-maybe /

[ICO]NameLast modifiedSizeDescription
[PARENTDIR]Parent Directory  -  
[DIR]test/2 years ago -  
[   ]LICENSE9 years ago1.1K 
[TXT]README.md9 years ago821 d768d73 docs [كارل مبارك]
[   ]index.js9 years ago408 3e510ca test new git [كارل مبارك]
[   ]package.json2 years ago1.6K3e510ca test new git [كارل مبارك]
README.md

call-me-maybe Build Status

Let your JS API users either give you a callback or receive a promise.

Usage

var maybe = require("call-me-maybe")

module.exports = function asyncFunc (cb) {
  return maybe(cb, new Promise(function(resolve, reject) {
    // ...
  }))
}

API

maybe(cb, promise)

If the callback cb is truthy, returns undefined and will call cb when promise is settled. The parameters passed to cb are standard error-first:

If cb is falsey, then promise is retuned.

Apache/2.4.38 (Debian) Server at www.karls.computer Port 80