Description
I'm fairly new to these modules and NPMs but I've been getting along okay until now, this module seems like it's exactly what I need to fix my TypeError: fs.readdir is not a function. The problem is brfs isn't doing anything and the description/examples are not helping me at all.
How the hell am I supposed to use this module?
The only other thing I can say is that I did install brfs, it is in my dependencies alongside browserify, and the command I use in terminal to output my project is "browserify -t brfs main.js > bundle.js"
Below is my code, I tried some other lines even closer to the examples given but they also did not work, just gave me more errors. What am I missing? Thanks in advance.
const path = require('path'); const fs = require('fs'); // READS ALL FILES IN VIDEO FOLDER // //joining path of directory const directoryPath = path.join(__dirname, './Videos'); //passsing directoryPath and callback function fs.readdir(directoryPath, function (err, files) { //handling error if (err) { return console.log('Unable to scan directory: ' + err); } //listing all files using forEach files.forEach(function (file) { // Do whatever you want to do with the file console.log(file); }); });