$ cnpm install vinyl-fs-browser
| Package | vinyl-fs |
| Description | Vinyl adapter for the file system |
| Node Version | >= 0.10 |
var map = require('map-stream');
var fs = require('vinyl-fs');
var log = function(file, cb) {
console.log(file.path);
cb(null, file);
};
fs.src(['./js/**/*.js', '!./js/vendor/*.js'])
.pipe(map(log))
.pipe(fs.dest('./output'));
fs.src(['!b*.js', '*.js'])
would not exclude any files, but this would
fs.src(['*.js', '!b*.js'])
Possible options for the second argument:
cwd - Specify the working directory the folder is relative to.
process.cwd().base - Specify the folder relative to the cwd. This is used to determine the file names when saving in .dest().
process.cwd() if there is no glob.buffer - true or false if you want to buffer the file.
true.false will make file.contents a paused Stream.read - true or false if you want the file to be read or not. Useful for stuff like rming files.
true.false will disable writing the file to disk via .dest().since - Date or number if you only want files that have been modified since the time specified.
stripBOM - true or false if you want the BOM to be stripped on UTF-8 encoded files.
true.passthrough - true or false if you want a duplex stream which passes items through and emits globbed files.
false.sourcemaps - true or false if you want files to have sourcemaps enabled.
false.gulp-sourcemaps under the hoodfollowSymlinks - true if you want to recursively resolve symlinks to their targets; set to false to preserve them as symlinks.
true.false will make file.symlink equal the original symlink's target path.Any glob-related options are documented in glob-stream and node-glob.
Returns a Readable stream by default, or a Duplex stream if the passthrough option is set to true.
This stream emits matching vinyl File objects.
Note: UTF-8 BOM will be stripped from all UTF-8 files read with .src.
Takes a folder path as the first argument.
First argument can also be a function that takes in a file and returns a folder path.
Possible options for the second argument:
cwd - Specify the working directory the folder is relative to.
process.cwd().base - Specify the folder relative to the cwd. This is used to determine the file names when saving in .dest().
cwd resolves to the folder path.mode - Specify the mode the files should be created with.
dirMode - Specify the mode the directory should be created with.
overwrite - Specify if existing files with the same path should be overwritten or not.
true, to always overwrite existing files.true or false.sourcemaps -
null aka do not write sourcemaps.gulp-sourcemaps under the hoodgulp-sourcemapsReturns a Readable/Writable stream.
On write the stream will save the vinyl File to disk at the folder/cwd specified.
After writing the file to disk, it will be emitted from the stream so you can keep piping these around.
If the file has a symlink attribute specifying a target path, then a symlink will be created.
The file will be modified after being written to this stream:
cwd, base, and path will be overwritten to match the folder.stat.mode will be overwritten if you used a mode parameter.contents will have it's position reset to the beginning if it is a stream.Takes a folder path as the first argument.
First argument can also be a function that takes in a file and returns a folder path.
Possible options for the second argument:
cwd - Specify the working directory the folder is relative to.
process.cwd().base - Specify the folder relative to the cwd. This is used to determine the file names when saving in .dest().
cwd resolves to the folder path.dirMode - Specify the mode the directory should be created with.
Returns a Readable/Writable stream.
On write the stream will create a symbolic link (i.e. symlink) on disk at the folder/cwd specified.
After creating the symbolic link, it will be emitted from the stream so you can keep piping these around.
The file will be modified after being written to this stream:
cwd, base, and path will be overwritten to match the folder.Copyright 2013 - present © cnpmjs.org | Home |