A Node.js file system walker with a Readable stream interface. Extracted from fs-extra.
I am walking a directory, `./source`, and even though I have specified a filter to include only markdown files via `path.extname()`, I am still receiving the root directory as an item in my final array. ``` let filterFn = function(item) { return path.extname(item) === ".md"; } return new Promise((resolve, reject) => { let items = []; fs.walk('./source', { filter: filterFn }).on('data', item => { items.push(item); }).on('end', () => { return resolve(items); }); }).then(items => { items.forEach(item => { console.log(item.path); // ['foo.md', 'bar.md', 'baz.md', 'source']; }); }); ``` # I expected `['foo.md', 'bar.md', 'baz.md'];` # I actually got `['foo.md', 'bar.md', 'baz.md', 'source'];`
This issue appears to be discussing a feature request or bug report related to the repository. Based on the content, it seems to be still under discussion. The issue was opened by lukeify and has received 5 comments.