Skip to content

Latest commit

 

History

History
20 lines (14 loc) · 929 Bytes

README.md

File metadata and controls

20 lines (14 loc) · 929 Bytes

@cameronhunter/async-with-timeout

npm package npm downloads 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;
});