I want to open a directory which containes a lot of files. I need to copy same information from every file, so I should be able to do something like this:
readdir('directory_name', (err, files) => {
if (err)
console.log(err);
else {
files.forEach(file => {
//copy what I want from the files
})
}
})
The problem is that the console gives me "readdir is not a function" and in the node_modules folder, in the fs section, there is a "README.md" file with this: "This package name is not currently in use, but was formerly occupied by another package. To avoid malicious use, npm is hanging on to the package name, but loosely, and we'll probably give it to you if you want it.
You may adopt this package by contacting [email protected] and requesting the name."
I'm using Javascript on browser.
Is it possible to open the directory in another way with the same result?
I'm a beginner in JavaScript programming.