A synchronous disk-based cache library for Node.js (v2.1.0, last updated in 2018). It stores cached values as files in a temporary directory (defaulting to TMPDIR/<username>). Supports optional gzip/deflate compression. Primarily used in build toolchains (e.g., Ember CLI) for caching intermediate results. Unlike its async sibling (async-disk-cache), this library uses blocking I/O, making it unsuitable for production servers but convenient for scripts and build tools.
npm install sync-disk-cacheNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Demonstrates basic usage: creating a cache instance, checking, getting, setting, removing, and clearing cached entries.
Consider migrating to an async alternative like async-disk-cache or a more modern caching library.
Use JSON.stringify() before storing and JSON.parse() when retrieving if you need to cache objects.
Only use compression options (gzip, deflate, deflateRaw) on Node.js >=0.12.
Set $TMPDIR to a project-specific path and manually purge it, or rely on OS tmpwatch/tmpreaper.
Run `npm install sync-disk-cache` in your project directory.
Check isCached property first: if (result.isCached) { use result.content } else { handle miss }No dependency data recorded yet.