Skip to content

Instantly share code, notes, and snippets.

@RReverser
Last active August 29, 2015 14:21
Show Gist options
  • Save RReverser/0a0263ec5abc5db03e05 to your computer and use it in GitHub Desktop.
Save RReverser/0a0263ec5abc5db03e05 to your computer and use it in GitHub Desktop.

Revisions

  1. RReverser revised this gist May 19, 2015. 1 changed file with 3 additions and 3 deletions.
    6 changes: 3 additions & 3 deletions gistfile1.js
    Original file line number Diff line number Diff line change
    @@ -1,12 +1,12 @@
    async function walk (dir, visitor) {
    const filenames = await fs.readdirAsync(dir);
    await Promise.all(filenames.map(async _filename => {
    await* filenames.map(async _filename => {
    const filename = path.join(dir, _filename);
    const stat = await fs.statAsync(filename);
    if (stat && stat.isDirectory()) {
    await walk(filename, visitor);
    } else {
    visitor(filename, stat);
    }
    }));
    }
    });
    }
  2. RReverser revised this gist May 19, 2015. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion gistfile1.js
    Original file line number Diff line number Diff line change
    @@ -1,6 +1,6 @@
    async function walk (dir, visitor) {
    const filenames = await fs.readdirAsync(dir);
    await Promise.all(filenames.map(_filename => {
    await Promise.all(filenames.map(async _filename => {
    const filename = path.join(dir, _filename);
    const stat = await fs.statAsync(filename);
    if (stat && stat.isDirectory()) {
  3. RReverser created this gist May 19, 2015.
    12 changes: 12 additions & 0 deletions gistfile1.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,12 @@
    async function walk (dir, visitor) {
    const filenames = await fs.readdirAsync(dir);
    await Promise.all(filenames.map(_filename => {
    const filename = path.join(dir, _filename);
    const stat = await fs.statAsync(filename);
    if (stat && stat.isDirectory()) {
    await walk(filename, visitor);
    } else {
    visitor(filename, stat);
    }
    }));
    }