async-listener is a polyfill and shim for the experimental `process.addAsyncListener` API, originally proposed for Node.js versions prior to 0.12 (specifically anticipated for 0.11.7). The package, currently at version 0.6.10, aimed to provide functionality for tracking asynchronous operations through `create`, `before`, `after`, and `error` hooks in an `AsyncListener` object. This API never landed in a stable version of Node.js core; it was a predecessor to what eventually became the `async_hooks` module (introduced in Node.js v8.0.0) and later the more user-friendly `AsyncLocalStorage` API (now stable). The package's release cadence was infrequent, with the last publish many years ago, aligning with its role as a temporary shim for an abandoned core feature. Its key differentiator was providing an early glimpse and implementation of async context tracking during Node.js's nascent stages of developing such features.
npm install async-listenerVerified import paths — ran on the pinned version, not inferred.
Demonstrates how to initialize and use `async-listener` to trace the lifecycle of asynchronous operations like `fs.readFile` and `setTimeout`, including `create`, `before`, `after`, and `error` hooks.
For modern Node.js (v8.0.0+), use the built-in `async_hooks` module or the higher-level `AsyncLocalStorage` API for async context tracking. Do not use `async-listener`.
Only use this package if you are strictly maintaining an application on Node.js 0.11.x. For any other Node.js version, consider native `async_hooks` or `AsyncLocalStorage`.
Migrate to Node.js's native `async_hooks` (experimental but mature) or `AsyncLocalStorage` (stable) for similar async context tracking capabilities. For example, use `AsyncLocalStorage` for request-scoped data in web applications.
Ensure `require('async-listener')` is executed before attempting to use its exports. If on a modern Node.js version, this API is unsupported; migrate to `async_hooks` or `AsyncLocalStorage`.Run `npm install async-listener`. If in an ESM module, consider if this ancient CJS package is suitable, or use `createRequire` for explicit CJS import.
No dependency data recorded yet.