A simple Promises/A+ library.


A simple Promises/A+ library.


P implements a subset of the Q API.

  • P(val)
  • P.reject(reason)
  • P.defer()
  • P.all(promises)
  • P.allSettled(promises)
  • P.spread(promises, onFulfilled, onRejected) :new:
  • P.promised(aFunction)
  • P.denodeify(aFunction) :new:
  • P.onerror
  • P.longStackSupport :new:
  • P.nextTick(callback)
  • deferred.promise
  • deferred.resolve(value)
  • deferred.reject(reason)
  • promise.then(onFulfilled, onRejected)
  • promise.done(onFulfilled, onRejected)
  • promise.fin(callback) :new:
  • promise.spread(onFulfilled, onRejected)
  • promise.all()
  • promise.allSettled()
  • promise.timeout(ms, opt_timeoutMsg)
  • promise.delay(ms)
  • promise.inspect()
  • promise.nodeify(nodeback) :new:





  • 9 Promising Promise Tips

    Promises are great to work with! Or so does your fellow developer at work says. This article would ...

    3 年前
  • should-promised

    Some sort of promise assertion helpers should-promised There some helpers for asserting promises. .P...

    2 年前
  • promise-all

    A Promise.all but for Objects as well as Arrays promise-all A Promise.all but for Objects as wel...

    2 年前
  • promise-each

    Call a function for each value in an array and return a Promise promise-each Call a function for...

    2 年前
  • promise

    Bare bones Promises/A+ implementation promise This is a simple implementation of Promises. It is a...

    2 年前
  • Promise.resolve vs new Promise(resolve)

    Pipo提出了一个问题:Promise.resolve vs new Promise(resolve),或许与您遇到的问题类似。 回答者Abdullah KhanBenjamin Gruenbaum给...

    3 年前
  • promisize

    Easily support both callbacks and promises in your js lib promisize Easily support both callbacks ...

    5 个月前
  • is-promise

    Test whether an object looks like a promises-a+ promise is-promise Test whether an object looks l...

    2 年前
  • once-promise

    Promisify events. once-promise Create promises for events. Contents Breaking changes Usage examp...

    1 年前
  • which-promise

    Promisified version of node-which which-promise Promisified version of node-which: Finds the ...

    2 年前


欢迎 JavaScript 爱好者