Ultralight promise extension compatible with Bluebird
NativeBird is compatible with a core Bluebird subset by extending native promise, and all of its extended APIs (implemented within ~200 lines) are fully tested with the corresponding test cases in Bluebird.
NativeBird can be used in several scenarios:
- To reuse promise utility methods like
Promise.eachwithout copying snippets from a gist.
- To perform migration in existing Bluebird projects.
npm install nativebird
import Promise from "nativebird";
It’s also fine to copy
promise.mjs and its type definition directly into your project directory.
- Static methods:
- Instance methods:
Promise.cancelis not supported.
- Synchronous inspection (e.g.
Promise.isFulfilled) is not supported.
To implement a new API in Bluebird, please also port the corresponding test cases under
test/mocha in Bluebird repo and test it with