Registry / devops / browserify-persist-redis

browserify-persist-redis

JSON →
library1.0.0jsnpmunverified

A caching plugin for browserify that stores intermediate transform results in Redis to accelerate repeated builds. Version 1.0.0 is the latest stable release; the package has not seen updates since November 2016. Unlike in-memory caches (e.g., browserify-cache), it persists across processes and shares cache across CI servers. Requires Redis >= 2.6.12 and browserify >= 12.0.0. Notable differentiator: uses an options object with `browserifyHash` and TTL, and relies on ioredis for Redis connectivity.

npm install browserify-persist-redis
INSTALL
IMPORT
SIG · BROWSERIFY-PERSIST
B
browserify-persist-redis
devopsjavascriptv1.0.0
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.

default
const bpr = require('browserify-persist-redis')();
import bpr from 'browserify-persist-redis'();
ESM import works but must call the default export; the default export is a factory function.
default with options
const bpr = require('browserify-persist-redis')({ ttl: 86400 });
const bpr = require('browserify-persist-redis')(ttl: 86400);
Options must be an object, not individual parameters.
with browserify
const bundle = browserify({ persistentCache: bpr });
const bundle = browserify({ cache: bpr });
The option key is `persistentCache`, not `cache`. This is a common mistake.

Shows basic usage: create a browserify instance with the redis persist cache, add an entry file, and pipe the bundle to stdout.

const browserify = require('browserify'); const bpr = require('browserify-persist-redis')(); const bundle = browserify({ persistentCache: bpr }); bundle.add('./browser/main.js'); bundle.bundle().pipe(process.stdout);
Debug
Known issues
breakingRequires browserify >= 12.0.0 and Redis >= 2.6.12; older versions will not work.
fix
Upgrade browserify and Redis to the required versions.
affects: <1.0.0
gotchaDefault TTL is two weeks (86400 * 14); stale cache may be served if transforms change without updating browserifyHash.
fix
Set a meaningful `browserifyHash` that includes versions of all transforms used.
affects: >=1.0.0
gotchaRedis connection defaults to localhost:6379; if Redis is elsewhere, configure via `redis` option.
fix
Pass Redis connection options: `{ redis: { host: 'my-redis.example.com', port: 6379 } }`
affects: >=1.0.0
deprecatedPackage is no longer actively maintained; no updates since November 2016.
fix
Consider alternatives like browserify-cache or custom caching solutions.
affects: >=1.0.0
gotchaThe default export is a factory function that must be called with or without options.
fix
Always call the required module: `require('browserify-persist-redis')()`
affects: >=1.0.0
Errors
Common errors & fixes
Error: Redis connection to 127.0.0.1:6379 failed
Redis server is not running or not accessible at the default host/port.
fix
Start Redis or configure a different Redis endpoint via the `redis` option.
browserify: 'persistentCache' must be a function
The `persistentCache` option expects a function (the result of calling the factory), but the module itself was passed.
fix
Call the required module: `require('browserify-persist-redis')()`
Module not found: Can't resolve 'ioredis'
ioredis is a required dependency but might be missing if installed incorrectly.
fix
Run `npm install browserify-persist-redis` which should install ioredis automatically, or manually install: `npm install ioredis`
Upgrade
Version history
1.0.0latest on npm
Audit
Dependencies
browserifyrequiredPeer dependency; plugin integrates with browserify's API via the `persistentCache` option
ioredisrequiredRuntime dependency; used for Redis client operations
Agent activity
6 hits · last 30 days
node
6
Resources
browserify-persist-redis — npm install browserify-persist-redis · libregistry