Registry / devops / gulp-file-cache

gulp-file-cache

JSON →
library0.0.1jsnpmunverified

A Gulp plugin for caching files to disk, enabling incremental builds by filtering out unchanged files between runs. Version 0.0.1 is the initial and only release, published with a sparse API including filter() and cache() methods. It creates a cache file (default .gulp-cache) and uses through2 streams. The project is unmaintained since 2014, with no updates, no TypeScript typings, and limited error handling. It is a simple alternative to more robust caching tools like gulp-cached or gulp-changed, but lacks features such as content-based hashing or cache invalidation.

npm install gulp-file-cache
INSTALL
IMPORT
SIG · GULP-FILE-CACHE
G
gulp-file-cache
devopsjavascriptv0.0.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.

FileCache
var FileCache = require('gulp-file-cache'); var fileCache = new FileCache();
import FileCache from 'gulp-file-cache';
The package is CommonJS only and does not support ES module imports. Use require() to load.
filter
fileCache.filter()
filter() is an instance method on FileCache objects. Not available as a static method.
cache
fileCache.cache()
cache() is an instance method that must be called after processing to update the cache. It returns a through stream.

Lints only new or modified JavaScript files since last run, using file-cache to skip unchanged files.

var FileCache = require('gulp-file-cache'); var gulp = require('gulp'); var jshint = require('gulp-jshint'); var fileCache = new FileCache(); gulp.task('lint-cached', function() { return gulp.src('./src/**/*.js') .pipe(fileCache.filter()) .pipe(jshint()) .pipe(fileCache.cache()); });
Debug
Known issues
gotchaCache file name can be set via constructor or create() method.
fix
Use new FileCache('my-cache-file') or FileCache.create('my-cache-file') to specify a custom cache file.
affects: >=0.0.0
gotchafilter() and cache() must be used as a pair; cache() updates the cache after processing.
fix
Always call fileCache.cache() after the transform to save the current file list for next run.
affects: >=0.0.0
gotchaNo TypeScript definitions available.
fix
Manual type declarations may be needed for TypeScript projects.
affects: >=0.0.0
deprecatedPackage is unmaintained since 2014.
fix
Consider migrating to actively maintained plugins like gulp-newer or gulp-changed.
affects: >=0.0.0
Errors
Common errors & fixes
Error: Cannot find module 'gulp-file-cache'
The package is not installed or not in node_modules.
fix
Run 'npm install --save-dev gulp-file-cache'.
TypeError: fileCache.filter is not a function
Instantiating FileCache incorrectly, e.g., calling require() as function or missing new.
fix
Use 'var fileCache = new FileCache();' then call 'fileCache.filter()'.
Error: no such file or directory, open '.gulp-cache'
First run, cache file does not exist yet.
fix
This error appears if the cache file is read before creation. Ensure filter() and cache() are used together, and the first run will create the cache file.
Upgrade
Version history
0.0.1latest on npm
Audit
Dependencies
through2requiredused to create transform streams for piping
Agent activity
6 hits · last 30 days
node
6
Resources
gulp-file-cache — npm install gulp-file-cache · libregistry