promise-timeout-plus

0.1.1 • Public • Published

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.

Package Sidebar

Install

npm i promise-timeout-plus

Weekly Downloads

0

Version

0.1.1

License

MIT

Last publish

Collaborators

  • andreaspizsa