Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

144
Visualizações
read all the files in a directory javascript

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 support@npmjs.com 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.

about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda