Sophie

Sophie

distrib > Mageia > 5 > i586 > media > core-release > by-pkgid > d85b9dfb82a0038d3e549c4b273d71a5 > files > 17

nodejs-readdirp-0.4.0-3.mga5.noarch.rpm

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