The process of the node from the program in c ++ starts
char fname[] = "D:/node.exe"; char cfname[] = "D:/node"; STARTUPINFO cif; ZeroMemory(&cif, sizeof(STARTUPINFO)); PROCESS_INFORMATION pi; CreateProcessA(NULL, fname, NULL, NULL, FALSE, CREATE_NEW_PROCESS_GROUP, NULL, cfname, &cif, &pi); To run the script for execution, you can simply replace "D: /node.exe" with "D: /node.exe run", but in this case the file with the code will have to be written to the hard disk and it can be read by an outsider. You can still execute the code by inputting it into the node's console, that's just how to make this input programmatically?
I tried this example http://www.sources.ru/cpp/using_anonymous_pipes.shtml , everything works with a regular console, but does not want a node window ...
-eoption no longer working?node -e 'console.log("what?")'- Alexey Tenhttps://nodejs.org/api/repl.html- Alexey Ten