nycki.net/tools/list-files.js

17 lines
393 B
JavaScript
Raw Normal View History

2024-12-28 06:22:51 +00:00
import fs from 'node:fs/promises';
import path from 'node:path';
async function main() {
let count = 0;
for (const file of await fs.readdir('_site', { recursive: true })) {
const absolute = path.join('_site', file);
const stat = await fs.stat(absolute);
if (stat.isDirectory()) continue;
console.log(file);
count += 1;
}
console.log(`total: ${count}`);
}
main();