Skip to content

A vinyl adapter to read from fstream into gulp pipelines

License

Notifications You must be signed in to change notification settings

pmoleri/vinyl-fstream

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

A vinyl adapter to read from fstream into gulp pipelines

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published