Async disk cache library for Node.js (v2.1.0, stable, low maintenance). Stores cache entries as files in a temporary directory (default $TMPDIR/<username>). Provides promise-based async API with compression support (gzip, deflate, deflateRaw) and optional buffer support. Differentiated from sync-disk-cache by async operations; a lightweight alternative to full-featured caching solutions like node-cache-manager. No external dependencies. Actively used in Ember CLI ecosystem.
npm install async-disk-cacheNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Demonstrates basic usage: create a cache, set a value, get it, remove it, and clear all.
Always pass a string as the first argument to the constructor.
Set $TMPDIR to a project-specific path and manually purge old entries, or rely on OS temp cleanup (e.g., tmpreaper on Linux, periodic tasks on macOS).
Test buffer support with your specific version; consider not using it if not needed.
Validate compression string against the allowed values.
Access the value via the returned object's 'value' property.
Use 'new Cache(key, options)'
Use require('async-disk-cache') as CommonJS; this package does not support ESM imports.Ensure $TMPDIR is set and the directory exists; use an absolute path if custom.
Pass a string as the first argument to new Cache('my-cache')No dependency data recorded yet.