nodejs get directory code example
Example 1: how to get cwd nodejs
process.cwd()
Example 2: read directory in node js
const testFolder = './tests/';
const fs = require('fs');
fs.readdir(testFolder, (err, files) => {
files.forEach(file => {
console.log(file);
});
});