@cameronhunter/async-with-timeout
v3.1.1
Published
A node utility function that implements timeout and AbortSignal support for async functions.
Downloads
37
Maintainers
Readme
@cameronhunter/async-with-timeout
A node utility function that implements timeout and AbortSignal
support for async functions.
Usage
import { withTimeout } from '@cameronhunter/async-with-timeout';
await withTimeout(5000, async () => {
const a: number = await longProcess();
const b: number = await anotherLongProcess();
return a + b;
});