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

186
Visualizações
Extract .jar file with NodeJS

I need to extract a JAR file using NodeJS and I have no idea how, also I'm not sure if StackOverFlow is the right place for this so sorry if it's not.

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

so jar files are just java archive files that can be unzipped with any commonly available operating system tool like unzip or jar, so a simple command like jar xvf /path/to/file.jar or unzip /path/to/file.jar should extract any .jar file. But since you want to use nodeJS to do it, you can make use of the exec function present in the node js code module called child_process.

you can create a simple function which takes in the path to the jar file like

const exec = require('child_process').exec;

extractJar(path) => {
  const command = `jar xvf ${path}`;
  exec(command, (err, stdout) => {
    if(err) console.log(err); return;
    console.log('success!');
  })
}

alternatively, you try by using libraries like unzipper, these do not depend upon your operating system tools as the exec command just executes the process on your shell, but these libraries use your node js IO operations for extracting.

about 4 years ago · Juan Pablo Isaza Relatório
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