A secure, reliable, offline-capable cache for npmd modules. Current stable version is 4.3.2. Provides an immutable content-addressable store for tarballs and a mutable database for module identifier to hash mappings. Supports offline install by caching modules from registry, GitHub, or arbitrary URLs. Differentiates from other caches by its content-addressable design and support for offline resolution via shasums.
npm install npmd-cacheNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Creates a cache instance, then demonstrates get, put, and resolve operations with callbacks.
Wrap methods with util.promisify or use a promise library like Bluebird's promisifyAll.
Ensure the directory exists before initializing cache, e.g., create with mkdirp.
Monitor release notes for resolve replacement.
Invoke cache as a function: const cache = require('npmd-cache')({ dir: '/my-cache' });Create the directory before using cache: mkdir -p /my-cache or use fs.mkdirSync with recursive option.
Install level: npm install level