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

251
Views
How to use C++ application in a Node.js server?

My goal is to use a C++ application in a web server written in JavaScript (such as Node.js). Do you have a solution for combining the two?

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

I'm not going to go too much in depth but in this case spawning process would be the "go to" option I guess.

Something like

const fs = require('fs');
const { spawn, exec } = require('child_process');

const logStream = fs.createWriteStream('./logFile.log');
const spawnedProcess = spawn("./some/path/to/executable.exe", [ "-flag1", "-flag2" ]);

// Handle error 
spawnedProcess.stderr.pipe(logStream);

// Read data
spawnedProcess.stdout.on('data', data => {
   console.log(data);
});

// Handle on exit
spawnedProcess.on('exit', c => {
    console.log(`Process closed with code: ${c}`);
});

// Send something to the process (the process has to handle it)
spawnedProcess.stdin.write("some command or whatever\n");

It will widely differ if it's your cpp app so you can implement handling this kind of communication or not. There's still a possibility to write some C++ "proxy" to let this kind of thing work though. If that won't work for you then let's hope that in some time someone with better idea will share some solution here.

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!