@cameronhunter/async-with-timeout
TypeScript icon, indicating that this package has built-in type declarations

3.1.1 • Public • Published

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

/@cameronhunter/async-with-timeout/

    Package Sidebar

    Install

    npm i @cameronhunter/async-with-timeout

    Weekly Downloads

    3

    Version

    3.1.1

    License

    MIT

    Unpacked Size

    4.69 kB

    Total Files

    5

    Last publish

    Collaborators

    • cameronhunter