Skip to content

Latest commit

 

History

History
35 lines (28 loc) · 580 Bytes

README.md

File metadata and controls

35 lines (28 loc) · 580 Bytes

wiothen

Promise, then, on filepaths in a directory tree

This is BETA.

Usage

var wiothen = require('wiothen');

wiothen('.', function(filepath, next) {
  // Skip dotfiles, coverage, node_modules
  if (!/^(\.|coverage|node_modules)/
    .test(filepath))
    console.log('got filepath:', filepath);
  next();
})
.then(function () {
  console.log('no more filepaths');
})
.catch(function (err) {
  console.log('got error:', err.message);
  return;
});

Output:

got filepath: package.json
got filepath: index.js
got filepath: README.md
no more filepaths