0.0.9 • Published 2 years ago

@zodash/timeout v0.0.9

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

@zodash/timeout

Timeout a promise-returning or async function

Usage

import { timeout } from '@zodash/timeout';
import * as fetch from 'node-fetch';

const run = async () => {
	const response = await fetch('https://sindresorhus.com/unicorn');

	// Abort retrying if the resource doesn't exist
	if (response.status === 404) {
		throw new Error(response.statusText);
	}

	return response.blob();
};

(async () => {
	console.log(await retry(run, {retries: 5}));
})();
0.0.9

2 years ago

0.0.8

2 years ago

0.0.5

3 years ago

0.0.4

3 years ago

0.0.7

2 years ago

0.0.6

2 years ago

0.0.3

3 years ago

0.0.2

3 years ago

0.0.1

3 years ago