retrying
TypeScript icon, indicating that this package has built-in type declarations

1.0.3 • Public • Published

retrying

NPM Version Node Version

retry a function

Installation

npm i retrying -S

Usage

import retry from 'retrying';
// for commonjs -> const retry = require('retrying').default;

function test() {
  throw new Error('12123');
  // return 1;
}

retry(test, { delay: 1000 })
  .then((ret) => {
    console.log(ret);
  })
  .catch((err) => {
    console.error(err);
  });

Examples

examples are listed at examples

Todo

  • [ ] xx

License

MIT

Readme

Keywords

Package Sidebar

Install

npm i retrying

Weekly Downloads

1

Version

1.0.3

License

MIT

Unpacked Size

8.3 kB

Total Files

5

Last publish

Collaborators

  • cooperhsiung