diff --git a/README.md b/README.md index b34b9f2a..1a664e1c 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ ## Usage ```javascript -var es = require('event-stream'); +var map = require('map-stream'); var fs = require('vinyl-fs'); var log = function(file, cb) { @@ -27,9 +27,9 @@ var log = function(file, cb) { cb(null, file); }; -fs.src(["./js/**/*.js", "!./js/vendor/*.js"]) - .pipe(es.map(log)) - .pipe(fs.dest("./output")); +fs.src(['./js/**/*.js', '!./js/vendor/*.js']) + .pipe(map(log)) + .pipe(fs.dest('./output')); ``` ## API @@ -38,6 +38,8 @@ fs.src(["./js/**/*.js", "!./js/vendor/*.js"]) - Takes a glob string or an array of glob strings as the first argument. - Possible options for the second argument: + - cwd - Specify the working directory the folder is relative to. Default is `process.cwd()` + - base - Specify the folder relative to the cwd. Default is where the glob begins. This is used to determine the file names when saving in `.dest()` - buffer - `true` or `false` if you want to buffer the file. - Default value is `true` - `false` will make file.contents a paused Stream @@ -68,7 +70,11 @@ This is just [glob-watcher] - mode - Specify the mode the files should be created with. Default is the mode of the input file (file.stat.mode) - Returns 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 +- After writing the file to disk, 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 + - `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 [glob-stream]: https://github.com/wearefractal/glob-stream [node-glob]: https://github.com/isaacs/node-glob