I have this code
async function addFiles(dir,tree) { return (await readDir(dir)) .map(async (name) => {await readDir(dir); return name;}) }
try
async function addFiles(dir,tree) { const files = await readDir(dir) await Promise.all(files.map(async (name) => {await readDir(dir); return name;}) }