retrying
v1.0.3
Published
retry a function
Downloads
7
Readme
retrying
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