events.js 285 B

1234567891011121314151617
  1. var glob = require('../');
  2. var g = glob([
  3. 'files/**',
  4. '!files/x/**',
  5. 'files/x/z.txt'
  6. ], function(err, files) {
  7. console.log(err || files);
  8. });
  9. g.on('match', function(f) {
  10. console.log('glob match: %s', f);
  11. });
  12. g.on('end', function() {
  13. console.log('globbing complete');
  14. });