DEV Community

Discussion on: Get files recursive with the Node.js File System (FS)

Collapse
vaibhav_arora__ profile image
Vaibhav Arora • Edited on

Change first 3 lines with -

const { readdir } = require('fs/promises');
async function getFiles(path = "./") {
const entries = await readdir(path, { withFileTypes: true });