Skip to content

p-promise

The promise module provides functions for creating and composing Promises.

use p-promise as p
FunctionDescription
p.resolve[value]Create a resolved Promise
p.reject[reason]Create a rejected Promise
p.create[executor]Create a new Promise with an executor function
p.delay[ms]Create a Promise that resolves after ms milliseconds
FunctionDescription
p.all[promises]Wait for all promises to resolve
p.allsettled[promises]Wait for all promises to settle (resolve or reject)
p.race[promises]Return the first promise to settle
p.any[promises]Return the first promise to resolve
FunctionDescription
p.timeout[promise; ms]Reject if a promise doesn’t settle within ms milliseconds