@vyriy/timeout
v0.9.5
Published
Timeout utility for Vyriy projects
Readme
@vyriy/timeout
Part of Vyriy - a calm architecture toolkit for TypeScript, React, SSR, SSG, APIs, and cloud-ready apps.
Full documentation: https://vyriy.dev/docs/timeout/
Timeout utility for Vyriy projects.
Purpose
This package provides a small helper that waits for a given amount of time and then throws an error.
Install
With npm:
npm install @vyriy/timeoutWith Yarn:
yarn add @vyriy/timeoutUsage
import { timeout } from '@vyriy/timeout';
await timeout(5000, 'Request took too long');Exports
The package exposes both the root entry and the direct utility module:
import { timeout } from '@vyriy/timeout';API
timeout(time, message?)waits fortimemilliseconds and then throws an error.messageoverrides the default'Timeout error!'text.
