ãã£ã¬ã¯ããªå å ¨ã¦ã®ãã¡ã¤ã«ä¸è¦§ãåå¾ããã¨ãããããµããå¦çã§ãããã¾ãã¾ã¯ã³ã©ã¤ãã¼ãæãã¤ããã®ã§ã¡ã¢ä»£ããã«ç´¹ä»ãã¾ã åæã¡ã½ãããªã®ã§ä½¿ãã©ããã«ã¯æ³¨æãã¦ãã ãã const fs = require('fs') const listFiles = (dir) => fs.readdirSync(dir, { withFileTypes: true }).flatMap(dirent => dirent.isFile() ? [`${dir}/${dirent.name}`] : listFiles(`${dir}/${dirent.name}`) ) console.log(listFiles('hoge/fuga')) fs.readdirã« withFileTypes: true ãªãã·ã§ã³ã追å ããã¦ããã§ãããæè¿ç¥ãã¾ãã https://nodejs.org/a
{{#tags}}- {{label}}
{{/tags}}