glob-stream
Advanced tools
Comparing version 3.1.3 to 3.1.5
@@ -0,5 +1,7 @@ | ||
/*jslint node: true */ | ||
'use strict'; | ||
var through = require('through'); | ||
var map = require('map-stream') | ||
var map = require('map-stream'); | ||
var Combine = require('combine-stream'); | ||
@@ -61,2 +63,3 @@ var unique = require('unique-stream'); | ||
var stream = through(); | ||
globber.on('error', stream.emit.bind(stream, 'error')); | ||
@@ -106,5 +109,5 @@ globber.on('end', function(){ | ||
// then just pipe them to a single stream and return it | ||
// then just pipe them to a single unique stream and return it | ||
var aggregate = new Combine(streams); | ||
var uniqueStream = unique('path'); | ||
var aggregate = new Combine(streams); | ||
@@ -111,0 +114,0 @@ // TODO: set up streaming queue so items come in order |
{ | ||
"name": "glob-stream", | ||
"description": "File system globs as a stream", | ||
"version": "3.1.3", | ||
"version": "3.1.5", | ||
"homepage": "http://github.com/wearefractal/glob-stream", | ||
@@ -6,0 +6,0 @@ "repository": "git://github.com/wearefractal/glob-stream.git", |
var gs = require('../'); | ||
var through = require('through'); | ||
var should = require('should'); | ||
@@ -6,3 +7,2 @@ require('mocha'); | ||
var join = path.join; | ||
var sep = path.sep; | ||
@@ -48,2 +48,28 @@ | ||
it('should return a file name stream from a glob and respect state', function(done) { | ||
var stream = gs.create("./fixtures/stuff/*.dmc", {cwd: __dirname}); | ||
var wrapper = stream.pipe(through(function(data){ | ||
this.pause(); | ||
setTimeout(function(){ | ||
this.queue(data); | ||
this.resume(); | ||
}.bind(this), 500); | ||
})); | ||
var count = 0; | ||
should.exist(stream); | ||
stream.on('error', function(err) { | ||
throw err; | ||
}); | ||
wrapper.on('data', function(file) { | ||
count++; | ||
}); | ||
wrapper.on('end', function(){ | ||
count.should.equal(2); | ||
done(); | ||
}); | ||
}); | ||
it('should return a correctly ordered file name stream for two globs and specified base', function(done) { | ||
@@ -50,0 +76,0 @@ var baseDir = join(__dirname, "./fixtures"); |
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
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
19910
415