blob: 0f7b327eb06256b1adb43a95ca4f42c57fca8e14 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
|
var readdirp = require('..')
, path = require('path');
readdirp({ root: path.join(__dirname), fileFilter: '*.js' })
.on('warn', function (err) {
console.error('something went wrong when processing an entry', err);
})
.on('error', function (err) {
console.error('something went fatally wrong and the stream was aborted', err);
})
.on('data', function (entry) {
console.log('%s is ready for processing', entry.path);
// process entry here
});
|