Answers for "node js read directory files"

5

node js get files in dir

const path = require('path');
const fs = require('fs');

fs.readdir(
  path.resolve(__dirname, 'MyFolder'),
  (err, files) => {
    if (err) throw err;
    
    for (let file of files) {
      console.log(file);
    }
  }
);
Posted by: Guest on September-07-2020
0

open folder node js

require('child_process').exec('start "" "c:\\test"');
Posted by: Guest on March-28-2020

Code answers related to "node js read directory files"

Code answers related to "Javascript"

Browse Popular Code Answers by Language