glob-stream
Advanced tools
Comparing version 5.2.0 to 5.3.0
13
index.js
@@ -8,6 +8,5 @@ 'use strict'; | ||
var glob = require('glob'); | ||
var Minimatch = require('minimatch').Minimatch; | ||
var micromatch = require('micromatch'); | ||
var resolveGlob = require('to-absolute-glob'); | ||
var glob2base = require('glob2base'); | ||
var path = require('path'); | ||
var globParent = require('glob-parent'); | ||
var extend = require('extend'); | ||
@@ -28,3 +27,3 @@ | ||
// Extract base path from glob | ||
var basePath = opt.base || glob2base(globber); | ||
var basePath = opt.base || globParent(ourGlob) + '/'; | ||
@@ -113,3 +112,3 @@ // Create stream and map events from globber to it | ||
var ourGlob = resolveGlob(glob, opt); | ||
glob = new Minimatch(ourGlob, ourOpt); | ||
glob = micromatch.matcher(ourGlob, ourOpt); | ||
} | ||
@@ -155,4 +154,4 @@ | ||
function isMatch(file, matcher) { | ||
if (matcher instanceof Minimatch) { | ||
return matcher.match(file.path); | ||
if (typeof matcher === 'function') { | ||
return matcher(file.path); | ||
} | ||
@@ -159,0 +158,0 @@ if (matcher instanceof RegExp) { |
{ | ||
"name": "glob-stream", | ||
"description": "File system globs as a stream", | ||
"version": "5.2.0", | ||
"repository": "wearefractal/glob-stream", | ||
"author": "Fractal <contact@wearefractal.com> (http://wearefractal.com/)", | ||
"version": "5.3.0", | ||
"description": "A wrapper around node-glob to make it streamy", | ||
"author": "Gulp Team <team@gulpjs.com> (http://gulpjs.com/)", | ||
"contributors": [], | ||
"homepage": "http://gulpjs.com", | ||
"repository": "gulpjs/glob-stream", | ||
"license": "MIT", | ||
"engines": { | ||
"node": ">= 0.10" | ||
}, | ||
"main": "index.js", | ||
"files": [ | ||
"index.js" | ||
], | ||
"scripts": { | ||
"lint": "eslint . && jscs *.js test/", | ||
"pretest": "npm run lint", | ||
"test": "mocha", | ||
"coveralls": "istanbul cover _mocha --report lcovonly && istanbul-coveralls" | ||
}, | ||
"dependencies": { | ||
"extend": "^3.0.0", | ||
"glob": "^5.0.3", | ||
"glob2base": "^0.0.12", | ||
"minimatch": "^2.0.1", | ||
"glob-parent": "^2.0.0", | ||
"micromatch": "^2.3.0", | ||
"ordered-read-streams": "^0.3.0", | ||
@@ -34,12 +47,6 @@ "through2": "^0.6.0", | ||
}, | ||
"scripts": { | ||
"lint": "eslint . && jscs *.js test/", | ||
"pretest": "npm run lint", | ||
"test": "mocha", | ||
"coveralls": "istanbul cover _mocha --report lcovonly && istanbul-coveralls" | ||
}, | ||
"engines": { | ||
"node": ">= 0.9" | ||
}, | ||
"license": "MIT" | ||
"keywords": [ | ||
"glob", | ||
"stream" | ||
] | ||
} |
@@ -1,22 +0,13 @@ | ||
# glob-stream [![NPM version][npm-image]][npm-url] [![Build Status][travis-image]][travis-url] [![Coveralls Status][coveralls-image]][coveralls-url] [![Dependency Status][david-image]][david-url] | ||
<p align="center"> | ||
<a href="http://gulpjs.com"> | ||
<img height="257" width="114" src="https://raw.githubusercontent.com/gulpjs/artwork/master/gulp-2x.png"> | ||
</a> | ||
</p> | ||
# glob-stream | ||
## Information | ||
[![NPM version][npm-image]][npm-url] [![Downloads][downloads-image]][npm-url] [![Build Status][travis-image]][travis-url] [![Coveralls Status][coveralls-image]][coveralls-url] [![Gitter chat][gitter-image]][gitter-url] | ||
<table> | ||
<tr> | ||
<td>Package</td><td>glob-stream</td> | ||
</tr> | ||
<tr> | ||
<td>Description</td> | ||
<td>File system globs as a stream</td> | ||
</tr> | ||
<tr> | ||
<td>Node Version</td> | ||
<td>>= 0.9</td> | ||
</tr> | ||
</table> | ||
A wrapper around [node-glob][node-glob-url] to make it streamy. | ||
This is a simple wrapper around node-glob to make it streamy. | ||
## Usage | ||
@@ -27,3 +18,3 @@ | ||
var stream = gs.create('./files/**/*.coffee', {options}); | ||
var stream = gs.create('./files/**/*.coffee', { /* options */ }); | ||
@@ -37,2 +28,12 @@ stream.on('data', function(file){ | ||
## API | ||
### create(globs, options) | ||
Returns a stream for multiple globs or filters. | ||
### createStream(positiveGlob, negativeGlobs, options) | ||
Returns a stream for a single glob or filter. | ||
### Options | ||
@@ -43,3 +44,3 @@ | ||
- base | ||
- Default is everything before a glob starts (see [glob2base](https://github.com/wearefractal/glob2base)) | ||
- Default is everything before a glob starts (see [glob-parent][glob-parent-url]) | ||
- cwdbase | ||
@@ -51,7 +52,7 @@ - Default is `false` | ||
- If true, won't emit an error when a glob pointing at a single file fails to match | ||
- Any through2 related options are documented in [through2](https://github.com/rvagg/through2) | ||
- Any through2 related options are documented in [through2][through2-url] | ||
This argument is passed directly to [node-glob](https://github.com/isaacs/node-glob) so check there for more options | ||
This argument is passed directly to [node-glob][node-glob-url] so check there for more options | ||
#### Glob | ||
### Glob | ||
@@ -74,7 +75,16 @@ ```js | ||
#### Related | ||
## Related | ||
- [globby](https://github.com/sindresorhus/globby) - Non-streaming `glob` wrapper with support for multiple patterns. | ||
- [globby][globby-url] - Non-streaming `glob` wrapper with support for multiple patterns. | ||
## License | ||
MIT | ||
[globby-url]: https://github.com/sindresorhus/globby | ||
[through2-url]: https://github.com/rvagg/through2 | ||
[node-glob-url]: https://github.com/isaacs/node-glob | ||
[glob-parent-url]: https://github.com/es128/glob-parent | ||
[downloads-image]: http://img.shields.io/npm/dm/glob-stream.svg | ||
[npm-url]: https://www.npmjs.com/package/glob-stream | ||
@@ -89,3 +99,3 @@ [npm-image]: https://badge.fury.io/js/glob-stream.svg | ||
[david-url]: https://david-dm.org/gulpjs/glob-stream | ||
[david-image]: https://david-dm.org/gulpjs/glob-stream.svg | ||
[gitter-url]: https://gitter.im/gulpjs/gulp | ||
[gitter-image]: https://badges.gitter.im/gulpjs/gulp.png |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
No website
QualityPackage does not have a website.
Found 1 instance in 1 package
9755
0
96
0
154
+ Addedglob-parent@^2.0.0
+ Addedmicromatch@^2.3.0
+ Addedarr-diff@2.0.0(transitive)
+ Addedarr-flatten@1.1.0(transitive)
+ Addedarray-unique@0.2.1(transitive)
+ Addedbraces@1.8.5(transitive)
+ Addedexpand-brackets@0.1.5(transitive)
+ Addedexpand-range@1.8.2(transitive)
+ Addedextglob@0.3.2(transitive)
+ Addedfilename-regex@2.0.1(transitive)
+ Addedfill-range@2.2.4(transitive)
+ Addedfor-in@1.0.2(transitive)
+ Addedfor-own@0.1.5(transitive)
+ Addedglob-base@0.3.0(transitive)
+ Addedglob-parent@2.0.0(transitive)
+ Addedis-buffer@1.1.6(transitive)
+ Addedis-dotfile@1.0.3(transitive)
+ Addedis-equal-shallow@0.1.3(transitive)
+ Addedis-extglob@1.0.0(transitive)
+ Addedis-glob@2.0.1(transitive)
+ Addedis-number@2.1.04.0.0(transitive)
+ Addedis-posix-bracket@0.1.1(transitive)
+ Addedis-primitive@2.0.0(transitive)
+ Addedisobject@2.1.0(transitive)
+ Addedkind-of@3.2.26.0.3(transitive)
+ Addedmath-random@1.0.4(transitive)
+ Addedmicromatch@2.3.11(transitive)
+ Addedminimatch@3.1.2(transitive)
+ Addednormalize-path@2.1.1(transitive)
+ Addedobject.omit@2.0.1(transitive)
+ Addedparse-glob@3.0.4(transitive)
+ Addedpreserve@0.2.0(transitive)
+ Addedrandomatic@3.1.1(transitive)
+ Addedregex-cache@0.4.4(transitive)
+ Addedremove-trailing-separator@1.1.0(transitive)
+ Addedrepeat-element@1.1.4(transitive)
+ Addedrepeat-string@1.6.1(transitive)
- Removedglob2base@^0.0.12
- Removedminimatch@^2.0.1
- Removedfind-index@0.1.1(transitive)
- Removedglob2base@0.0.12(transitive)
- Removedminimatch@2.0.10(transitive)