wecui
Version:
一款基于Vue2.x版本的移动端web组件
68 lines (48 loc) • 2.02 kB
Markdown
as a stream</td>
</tr>
<tr>
<td>Node Version</td>
<td>>= 0.9</td>
</tr>
</table>
This is a simple wrapper around node-glob to make it streamy.
```javascript
var gs = require('glob-stream');
var stream = gs.create("./files/**/*.coffee", {options});
stream.on('data', function(file){
// file has path, base, and cwd attrs
});
```
You can pass any combination of globs. One caveat is that you can not only pass a glob negation, you must give it at least one positive glob so it knows where to start. All given must match for the file to be returned.
- cwd
- Default is `process.cwd()`
- base
- Default is everything before a glob starts (see [glob2base](https://github.com/wearefractal/glob2base))
- cwdbase
- Default is `false`
- When true it is the same as saying opt.base = opt.cwd
This argument is passed directly to [node-glob](https://github.com/isaacs/node-glob) so check there for more options
```javascript
var stream = gs.create(["./**/*.js", "!./node_modules/**/*.*"]);
```
[ ]: https://npmjs.org/package/glob-stream
[ ]: https://badge.fury.io/js/glob-stream.png
[ ]: https://travis-ci.org/wearefractal/glob-stream
[ ]: https://travis-ci.org/wearefractal/glob-stream.png?branch=master
[ ]: https://coveralls.io/r/wearefractal/glob-stream
[ ]: https://coveralls.io/repos/wearefractal/glob-stream/badge.png
[ ]: https://david-dm.org/wearefractal/glob-stream
[ ]: https://david-dm.org/wearefractal/glob-stream.png
[ ]: https://david-dm.org/wearefractal/glob-stream
[ ]: https://david-dm.org/wearefractal/glob-stream.png?theme=shields.io
<table>
<tr>
<td>Package</td><td>glob-stream</td>
</tr>
<tr>
<td>Description</td>
<td>File system globs