1
0
mirror of https://github.com/mgerb/mywebsite synced 2026-01-13 11:12:47 +00:00
Files
mywebsite/node_modules/readdirp/examples/stream-api.js
2016-01-04 12:25:28 -05:00

16 lines
479 B
JavaScript

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
});