Try shelljs to call c/c++ program or shared libraries by using node program from linux/unix . node-cmd an option in windows. Both packages basically enable us to call c/c++ program similar to the way we call from terminal/command line.
Eg in ubuntu:
const shell = require('shelljs');
shell.exec("command or script name");
In windows:
const cmd = require('node-cmd');
cmd.run('command here');
Note: shelljs and node-cmd are for running os commands, not specific to c/c++.