gulpjs / glob-stream

Readable streamx interface over anymatch.
MIT License
178 stars 53 forks source link

node-glob "nonull" functionality is lost #17

Closed danhaller closed 10 years ago

danhaller commented 10 years ago

In node-glob, when there are 0 file matches and the "nonull" option is set, the original glob pattern is emitted with the end event. This behaviour is currently lost in glob-stream because the 'end' event handler just closes the stream.

My use case for this functionality was with gulp: I wanted to pass a file name that didn't exist yet to a gulp plugin. Maybe I shouldn't be doing that! I can currently work around the problem in gulp with the following:

gulp.src('./a-file-that-exists', { read : false }) .pipe(rename('the-path-i-want-to-pass-around'))

yocontra commented 10 years ago

No, if you want virtual files just make them yourself.

var File = require('vinyl');

var fakeFile = new File({
  base: '/home/'
  path: '/home/test.js'
});