Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

188
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!