When I try this
require('glob-fs')().readdirPromise('**/*.yaml').then((_)=>console.log(_))
I see just just all files in dir
I suppose that error is somewhere here:
readdirPromise: function(pattern, options) {
this.emit('read');
this.setPattern(pattern, options);
var res = this.iteratorPromise(this.pattern.base);
this.emit('end', this.files);
return res;
}
because it's strange to me that end is emitted before promise is resolved.
but change from this:
this.emit('end', this.files);
to this:
res.then(() => this.emit('end', this.files));
didn't help
Did I used this method properly? Or am I missing somethig? Or is there some error?
When I try this
I see just just all files in dir
I suppose that error is somewhere here:
because it's strange to me that
endis emitted before promise is resolved.but change from this:
to this:
didn't help
Did I used this method properly? Or am I missing somethig? Or is there some error?