|
|
|
|
|
by latchkey
864 days ago
|
|
Wouldn't the `await fs.move` run sync? Why not just return the Promise from fs.move() so that Promise.all() can run the multiple moves async? await Promise.all(
unneededPages.map(async (page) => {
await fs.move(page, `scripts/.cache/${page}`, { overwrite: true });
})
);
Similar to what you do on line 26. |
|
I could have appended it to the Promises that I'm creating on line 9 to run it in parallel with those moves, but this is not performance-critical code, and moving the two conceptually-unrelated concepts into the same expression wouldn't aid legibility, in my opinion. And since I'm the only one who needs to read the code, that opinion wins by default :)