How to use the walker function in walker

To help you get started, we’ve selected a few walker examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github sebastian-software / edgestack / src / scripts / bootstrap.js View on Github external
return new Promise((resolve, reject) =>
  {
    walker(startPath)
      .on("file", (file, stat) =>
      {
        promisedChanges.push(
          copyFile(file, pathModule.join(targetPath, pathModule.relative(startPath, file)), replacementCallback)
        )
      })
      .on("error", (error, entry) =>
      {
        console.error(chalk.red(`Error ${error} on entry ${entry}`))
      })
      .on("end", async () => {
        await Promise.all(promisedChanges)
        resolve()
      })
  })
}
github facebook / jest / packages / jest-haste-map / src / lib / FSEventsWatcher.ts View on Github external
private static recReaddir(
    dir: string,
    dirCallback: (normalizedPath: string, stats: fs.Stats) => void,
    fileCallback: (normalizedPath: string, stats: fs.Stats) => void,
    endCallback: Function,
    errorCallback: Function,
    ignored?: Matcher,
  ) {
    walker(dir)
      .filterDir(
        (currentDir: string) => !ignored || !anymatch(ignored, currentDir),
      )
      .on('dir', FSEventsWatcher.normalizeProxy(dirCallback))
      .on('file', FSEventsWatcher.normalizeProxy(fileCallback))
      .on('error', errorCallback)
      .on('end', () => {
        endCallback();
      });
  }

walker

A simple directory tree walker.

Apache-2.0
Latest version published 3 years ago

Package Health Score

67 / 100
Full package analysis

Popular walker functions