Denote
A JavaScript promise library - because we don't have enough of those already.
- No external dependencies
- Provides equivalent API methods to the ES2015 Promise specification
- Meets the Promises/A+ specification
Installation
npm install denote
Example Usage
var denote = ;
Using deferred promise creation
{ var promise = ; ; return promise;} ;
Using an executor function
;
Creating immediately fulfilled or rejected promises
denote;
denote.all
to handle many promises
Using var promises = denote 'howdy!'; denoteallpromises;
denote.race
to handle the first promise to complete
Using var morePromises = denote 'tra la la'; denote;
API
View the online documentation for details.
denote = require('denote')
denote([executor])
- returns a new Denote promise instancedenote.resolve(value)
denote.reject(reason)
denote.all(list)
denote.race(list)
Denote.prototype
Denote.prototype.then(onFulfilled, onRejected)
Denote.prototype.catch(onRejected)
Denote.prototype.resolve(value)
Denote.prototype.reject(reason)
Contributing
git clone https://github.com/msrose/denote.gitcd denotenpm install
To run the project's own test suite: npm test
To run the Promises/A+ compliance tests: npm run test:aplus
Before submitting a pull request, make sure that:
- you've written tests for any new features,
- the code conforms to the eslint configuration for this project,
- and that all the tests pass
npm run lint && npm run test:all
Making a Release
npm run lintnpm run test:allgit checkout developnpm version major|minor|patchgit push origin developgit checkout gh-pagesgit merge developjsdoc -c jsdoc.conf.json -R README.md -P package.jsongit add docsgit commit -m "Update docs"git push origin gh-pagesgit checkout mastergit merge developgit push origin --tags masternpm publish