How to use the recursive-readdir.default function in recursive-readdir

To help you get started, we’ve selected a few recursive-readdir 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 toshi1127 / css-optimization / cli / src / bin / cli.ts View on Github external
async function main(pg) {
  debug(pg);
  const { parallel, path: caseDir, ...options } = prepare(pg);

  if (cluster.isMaster) {
    const files = ((await readdir(
      path.resolve(process.cwd(), caseDir)
    )) as string[])
      .sort()
      .filter(f => {
        return f.endsWith("yaml") || f.endsWith("yml");
      });
    if (!parallel) {
      // single thread
      for (const f of files) {
        await pprun({ file: f, options });
      }
      return;
    }
    // multi thread
    const pNum = Math.max(numCPUs, parallel);
    for (let i = 0; i < pNum; i++) {

recursive-readdir

Get an array of all files in a directory and subdirectories.

MIT
Latest version published 2 years ago

Package Health Score

74 / 100
Full package analysis