A high-priority task queue for Node.js and browsers (version 2.0.6 stable; last release 2019+; no active development). Schedules callbacks to run as soon as possible, before yielding for I/O, reflow, or redrawing. Uses microtasks/nextTick/setTimeout depending on environment. Faster than setImmediate/process.nextTick but can block input events and animation. Includes `asap/raw` for even faster execution without error handling. Minimalist (~1KB) with no dependencies.
npm install asapNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Demonstrates scheduling a task to run as soon as possible, before any I/O or rendering.
For animation-related tasks, replace asap with requestAnimationFrame: requestAnimationFrame(callback).
Monitor with heart-beat signals or use `setImmediate` to break long processes: setImmediate(callback).
Use the default asap (which handles errors) or manually call rawAsap.requestFlush() after handling the error.
Use `asap` (default) instead of `asap/raw` to ensure error handling.
If you need true before-I/O execution, verify Node.js version or use a more recent microtask mechanism.
Use `import asap from 'asap'` instead of `import { asap } from 'asap'`.Ensure your bundler (Webpack, ESBuild) supports subpath exports. Or use `require('asap/raw')` in Node.js.Add `const asap = require('asap');` at the top.No dependency data recorded yet.