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

258
Visualizações
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 Respostas
Responde à pergunta

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 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