Skip to content
Advertisement

Tag: dirname

node.js multiple __dirnames

Can I put more than one file/directory down with __dirname ? example: const dirPath = path.join(__dirname, ‘/candles’); const dirPath = path.join(__dirname, ‘/lightbulbs’); const dirPath = path.join(__dirname, ‘/flashlights’); versus some sort of const dirPath = path.join(__dirname, {‘/pictures’, ‘/lightbulbs’, ‘/flashlights’}); I wish to have a list of files instead of a directory. Answer For this question, you should really try what you

Advertisement