Registry / testing / downcache

downcache

JSON →
library0.1.2jsnpmunverified

downcache is a Node.js module (v0.1.2, low release cadence) for downloading and caching webpages to disk for fast future retrieval in scraping projects. It wraps the deprecated 'request' library but aims to migrate to a modern HTTP client. Key differentiator: automatically caches HTML responses locally based on URL structure, reducing redundant network calls. Currently in maintenance mode with an open call for contributions to modernize dependencies and add promises.

npm install downcache
INSTALL
IMPORT
SIG · DOWNCACHE
D
downcache
testingjavascriptv0.1.2
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

downcache
const downcache = require('downcache')
import downcache from 'downcache'
Package does not support ESM; CommonJS only.
downcache
const downcache = require('downcache')
const { downcache } = require('downcache')
downcache is exported as a function directly, not as a named export.
downcache
const downcache = require('downcache')
const downcache = require('downcache').default
No default export; the main export is the function.

Shows basic usage: require the module, call with a URL and options (custom cache dir, no force), and handle the response via callback.

const downcache = require('downcache'); const url = 'http://example.com'; downcache(url, { dir: './cache', force: false }, (err, resp, body) => { if (err) throw err; console.log('Response length:', body.length); });
Debug
Known issues
deprecatedThe 'request' dependency is deprecated as of version 0.1.2, and the package is in the process of moving to a modern alternative.
fix
Monitor the repository for updates or contribute to migration.
affects: >=0.0.0
gotchaCallback does not support Promises or async/await natively; must use callbacks.
fix
Use util.promisify or wrap in a Promise manually.
affects: >=0.0.0
gotchaCached files are stored with URL-derived paths; extensive caching may create many directories and files.
fix
Specify a custom 'dir' and 'path' option to control storage structure.
affects: >=0.0.0
gotchaThe 'limit' option adds a delay between requests; setting too low may be ignored.
fix
Set 'limit' to a positive integer (milliseconds).
affects: >=0.0.0
deprecatedPackage is in maintenance mode; no active development and issues may not be resolved quickly.
fix
Consider alternatives like 'axios-cache-adapter' or 'node-fetch-cache'.
affects: >=0.0.0
deprecatedThe 'log' option uses npmlog, which is outdated.
fix
Use custom logging or suppress logs.
affects: >=0.0.0
Errors
Common errors & fixes
downcache is not defined
Incorrect import syntax (e.g., ES6 import) or missing require.
fix
Use `const downcache = require('downcache');`
Cannot find module 'request'
The 'request' dependency may not be installed or is deprecated; npm install may have failed.
fix
Run `npm install` from the project root to install all dependencies.
TypeError: downcache is not a function
Importing default instead of the function (e.g., `import downcache from 'downcache'`).
fix
Use CommonJS: `const downcache = require('downcache');`
ENOENT: no such file or directory, open './cache/...'
Cache directory does not exist or path is incorrect.
fix
Ensure the cache directory exists or set 'dir' option to an existing directory.
Upgrade
Version history
0.1.2latest on npm
Audit
Dependencies
requestrequiredused for HTTP requests (deprecated, planned to be replaced)
Agent activity
2 hits · last 30 days
node
2
Resources