UNPKG

es-toolkit

Version:

A state-of-the-art, high-performance JavaScript utility library with a small bundle size and strong type annotations.

8 lines (5 loc) 154 B
import { timeout } from './timeout.mjs'; async function withTimeout(run, ms) { return Promise.race([run(), timeout(ms)]); } export { withTimeout };