1 var readdirp = require('..')
2 , path = require('path');
4 readdirp({ root: path.join(__dirname), fileFilter: '*.js' })
5 .on('warn', function (err) {
6 console.error('something went wrong when processing an entry', err);
8 .on('error', function (err) {
9 console.error('something went fatally wrong and the stream was aborted', err);
11 .on('data', function (entry) {
12 console.log('%s is ready for processing', entry.path);