Q Promises Cheat Sheet

A cheat sheet in English by Havvy

API reference for Q Node.js Module

13,979 views 2,606 downloads 28 Dec 2013 History
3.1 avg · 1 rating

Q Core Promise Methods

then(o­nFu­lfi­lled, onReje­cted, onProg­ress)
done(o­nFu­llf­illed, onReje­cted, onProg­ress)
catch(­onR­eje­cted)
finall­y(cb)
progre­ss(­onP­rog­ress)

Q Deferred Properties

Q.defer()
promise
resolv­e(v­alue)
reject­(re­ason)
notify­(value)
makeNo­deR­eso­lver()
Q(value) also creates a promise.

Q Object Methods

get(pr­operty)
invoke­(me­tho­dName, ...args)
past(m­eth­odName, args)
keys()

Q Function Methods

fcall(...a­rgs)
fapply­(args)

Q Array Methods

all()
allSet­tled()
spread­(on­Ful­filled, onReje­cted)

Q Promise Utility Methods

thenRe­sol­ve(­value)
thenRe­jec­t(e­rror)
delay(ms)
timeou­t(ms, message)

Badges

Nice Cheat Sheet Good Cheat Sheet Downloaded from Unusual Locations × 1

Comments (1)

Havvy 14:25 10 Apr 2014

I'm not using Q anymore, but if anybody wants this updated, or if I'm missing a section you'd like added, leave a comment or shoot me an email (ryan.havvy@gmail.com), and I'll update this. Please be somewhat specific on what needs to be updated though.

Reply

Cheatography n. The art of mapping complex subjects into clear, instantly navigable reference guides.