1.0.4 • Published 8 years ago

vinyl-fstream v1.0.4

Weekly downloads
2
License
MIT
Repository
github
Last release
8 years ago

Vinyl adapter to read a fstream into a gulp pipeline

It takes a fstream as input and returns a gulp stream of vinyl files.

NPM version Downloads Build Status

Examples

Copy a directory

var fstream = require("fstream");
var vfs = require("vinyl-fstream");

gulp.task("copy", function() {
    return vfs.src(fstream.Reader("./"))
        .pipe(gulp.dest("../dist"));
}

Note: this example is only for instructional purpose, as it is easier to use gulp.src("./*").

Zip a npm package

var npmPacker = require("fstream-npm");
var vfs = require("vinyl-fstream");
var zip = require("gulp-zip");

gulp.task("zip", function() {
    return vfs.src(npmPacker("./"))
        .pipe(zip(fileName))
        .pipe(gulp.dest("dist"));
}

Note: fstream-npm takes in consideration .npmignore and package.json files property, so the zip will contain only what would be packaged by npm pack.

Api

vfs.src(streams, options)

streams: It can be a fstream or an array of fstreams

options (optional): It accepts the "read" and "buffer" options of vinyl-fs.

Note: Usually fstream entries are consumed one at a time and fstream's api doesn't state if entries can be consumed simultaneously, so use buffer: false under your own risk.