nonull not working? #43

cowboy opened this Issue May 6, 2012 · 5 comments


None yet

3 participants

cowboy commented May 6, 2012

If nonull was set, shouldn't the returned array always contain at least something? I'm using glob@3.1.9.

var glob = require('glob');

glob.sync('xyz', {nonull: true}); // []

glob('xyz', {nonull: true}, function(err, files) {
  console.log(err, files); // logs: null []
cowboy commented Jun 4, 2012

Any thoughts on this issue?

cowboy commented Jul 31, 2012

I'm still seeing this behavior in v3.1.11. What's the point of the nonull setting if it doesn't return the originally-specified pattern in the array when files aren't matched?

Per the readme:

nonull Set to never return an empty set, instead returning a set containing the pattern itself. This is the default in glob(3).

benatkin commented Aug 6, 2012

On this line:


If that's the only bug causing this behavior it ought to fix it.

@isaacs isaacs closed this in 1be0c30 Aug 6, 2012
isaacs commented Aug 6, 2012

Yep. That's the bug, alright. Thanks.

cowboy commented Aug 6, 2012


This was referenced Mar 9, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment