Archive. Date of access: 12 Jan 2022
|
10 years ago | |
---|---|---|
examples | 10 years ago | |
test | 10 years ago | |
.gitignore | 10 years ago | |
README.md | 10 years ago | |
index.js | 10 years ago | |
package.json | 10 years ago |
Package | vinyl-diff |
Description | Perform diffs of vinyl streams |
Node Version | >= 0.10 |
This library allows you to perform diffs between streams of vinyl.
This enables the ability to only push vinyl files that have changed down the stream.
All vinyl-adapters are compatible with this module.
Alternatives to using this module could be gulp-changed
, but gulp-changed
is bound to the file-system and unable to compare arbitrary vinyl streams.
var changed = require('../index').changed;
var vfs = require('vinyl-fs');
var map = require('map-stream');
var log = function (file, cb){
console.log(file)
cb(null, file);
};
vfs.src('./test/fixtures/new-files/**')
.pipe(map(log))
.pipe(changed(vfs.src('./test/fixtures/old-files/**'), { compare: "sha", dest: "old-files"}))
.pipe(map(log));
var changed = require('../index').changed;
var vfs = require('vinyl-fs');
var map = require('map-stream');
var log = function (file, cb){
console.log(file)
cb(null, file);
};
vfs.src('./test/fixtures/new-files/**')
.pipe(map(log))
.pipe(changed(vfs.src('./test/fixtures/old-files/**'), { compare: "mtime", dest: "old-files"}))
.pipe(map(log));
sha
. Also available: mtime