Skip to content

Commit

Permalink
Docs: Update options & vinyl property changes
Browse files Browse the repository at this point in the history
  • Loading branch information
yocontra authored and phated committed Nov 28, 2017
1 parent a722d04 commit 8c158db
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions README.md
Expand Up @@ -19,17 +19,17 @@
## Usage

```javascript
var es = require('event-stream');
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(es.map(log))
.pipe(fs.dest("./output"));
fs.src(['./js/**/*.js', '!./js/vendor/*.js'])
.pipe(map(log))
.pipe(fs.dest('./output'));
```

## API
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 8c158db

Please sign in to comment.