0.1.1 • Published 8 years ago

promise-timeout-plus v0.1.1

Weekly downloads
1
License
MIT
Repository
github
Last release
8 years ago

promise-timeout-plus Travis Coverage Status Downloads

Promise.timeout() for ES6; reject a Promise after a given timeout.

Install

Install with npm

$ npm i promise-timeout-plus --save

Usage

// var Promise = require('any-promise');
require('promise-timeout-plus')(Promise);

myPromiseFunction('Hello')
  .timeout(1000)
  .then(console.log);

// --> 'Hello' if myPromiseFunction resolved within 1000ms

API

`.timeout(ms,error)

Reject the promise if it's not resolved after ms milliseconds

Running tests

Install dev dependencies:

$ npm i -d && npm test

Contributing

Pull requests and stars are always welcome. For bugs and feature requests, please create an issue.

Author

Andreas Pizsa

License

Copyright © 2016 Andreas Pizsa Released under the MIT license.


This file was generated by verb-cli on February 09, 2016.