3.1.1 • Published 2 years ago

@cameronhunter/async-with-timeout v3.1.1

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

@cameronhunter/async-with-timeout

npm package main branch status

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;
});