Registry / testing / gulp-cached

gulp-cached

JSON →
library1.1.1jsnpmunverified

In-memory file cache for Gulp that skips unchanged files across runs, reducing processing time. Version 1.1.1 is the latest stable release (last updated 2015). It stores file contents in memory and compares them on subsequent passes; only files with changed content are emitted downstream. Supports an optimizeMemory option for md5 checksums. Works with Gulp 3.x and 4.x. Unlike gulp-changed which compares file timestamps, gulp-cached uses content comparison, ensuring accurate change detection.

npm install gulp-cached
INSTALL
IMPORT
SIG · GULP-CACHED
G
gulp-cached
testingjavascriptv1.1.1
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.

cache
var cache = require('gulp-cached');
import cache from 'gulp-cached';
This package does not provide ESM exports; use CommonJS require.

Example using gulp-cached to cache linting files, skipping unchanged files.

var gulp = require('gulp'); var jshint = require('gulp-jshint'); var cache = require('gulp-cached'); gulp.task('lint', function() { return gulp.src('files/*.js') .pipe(cache('linting')) .pipe(jshint()) .pipe(jshint.reporter('default')); }); gulp.task('watch', function() { gulp.watch('files/*.js', gulp.series('lint')); }); gulp.task('default', gulp.series('watch', 'lint'));
Debug
Known issues
gotchaCache key is based on file.path + file.contents; plugins that modify file.contents before caching will cause false cache misses.
fix
Ensure cache() is placed before any transformation plugins that change file contents.
affects: >=0.0.0
gotchaDoes not work with plugins that operate on sets of files (e.g., gulp-concat).
fix
Use gulp-cached only for per-file transformations; do not use before aggregation plugins.
affects: >=0.0.0
deprecatedPackage is in maintenance mode with no updates since 2015. Consider using 'gulp-changed' or 'gulp-newer' as more actively maintained alternatives.
fix
Migrate to gulp-changed (file timestamp based) or gulp-newer (last modified time).
affects: >=1.1.1
Errors
Common errors & fixes
TypeError: cache is not a function
Incorrect import: using ES6 import syntax with a CJS-only module.
fix
Use require('gulp-cached') instead of import.
gulp-cached: cache name required
Missing cache name argument when calling cache().
fix
call cache('cacheName') with a string argument.
gulp-cached: stream must be in objectMode
Using gulp-cached with a stream that is not in objectMode (e.g., after gulp.dest).
fix
Place cache() before any streaming transformations; use gulp.src() output directly.
Upgrade
Version history
1.1.1latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
4 hits · last 30 days
node
4
Resources