Show Menu
Cheatography

Q Promises Cheat Sheet by

API reference for Q Node.js Module

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)
       

Help Us Go Positive!

We offset our carbon usage with Ecologi. Click the link below to help us!

We offset our carbon footprint via Ecologi
 

Comments

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.

Add a Comment

Your Comment

Please enter your name.

    Please enter your email address

      Please enter your Comment.

          Related Cheat Sheets

          EQ tips Cheat Sheet
          AngularJS Cheat Sheet
          Poker Cheat Sheet

          More Cheat Sheets by Havvy

          Tennu Cheat Sheet