This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const fs = require("fs"); | |
const path = require("path"); | |
const dir = process.argv.slice(2)[0]; | |
if (dir == null) throw new Error("No directory provided"); | |
const files = fs | |
.readdirSync(dir, { withFileTypes: true }) | |
.filter((item) => item.isFile()); |