src/lib/index.js
function listFiles(dir, callback) {
  return new Promise((resolveThis, reject) => {
    walk.walk(dir, { followLinks: true })
    .on('file', (root, stats, next) => {
      const destDir = relative(dir, root);
      const relativePath = destDir ? join(destDir, stats.name) : stats.name;
      resolve(relativePath).then(callback).then(next);
    })
    .on('errors', reject)
    .on('end', resolveThis);
  });
}
function listFiles(dir, callback) {
  return new Promise((resolveThis, reject) => {
    walk.walk(dir, { followLinks: true })
    .on('file', (root, stats, next) => {
      const destDir = relative(dir, root);
      const relativePath = destDir ? join(destDir, stats.name) : stats.name;
      resolve(relativePath).then(callback).then(next);
    })
    .on('errors', reject)
    .on('end', resolveThis);
  });
}
function listFiles ( dir , callback ) { return new Promise ( ( resolveThis , reject ) => { walk . walk ( dir , { followLinks : true } ) . on ( 'file' , ( root , stats , next ) => { const destDir = relative ( dir , root ) ; const relativePath = destDir ? join ( destDir , stats . name ) : stats . name ; resolve ( relativePath ) . then ( callback ) . then ( next ) ; } ) . on ( 'errors' , reject ) . on ( 'end' , resolveThis ) ; } ) ; }
Lists files of a directory recursively. Follows symbolic links.
@param {String} dir Directory to scan
@param {Function()} callback Callback executed when a file is found. Can return a Promise.
@return {Promise} A new promise that is resolved once the given directory
has been scanned entirely and all callbacks have completed.
Lists files of a directory recursively . Follows symbolic links .