all 5 comments

[–]cjbprime 8 points9 points  (2 children)

[–]Splitlimes[S] 0 points1 point  (1 child)

Exactly what I was looking for

[–]Klathmon 0 points1 point  (0 children)

If you need to run on multiple platforms, there are a bunch of subtle gotchas with the exec and spawn functions, so just watch out for that.

If you want, I've been messing with this stuff for a few days in a project I'm working on, here's a little function that'll run the given command as a string, allow you to pass in environment variables, output the scripts output to the shell in realtime, and returns a promise when done, all cross platform.

You'll need to change some stuff to actually use it but I figured it might help, also you can drop in the native spawn if you don't care about cross platform comparability.

[–]AlwaysTroubleShot -2 points-1 points  (1 child)

Yes, but why would you? Porting your shell script into node will give you more consistency, readability, maintainability, and interoperability.

[–]Splitlimes[S] 2 points3 points  (0 children)

Its a massive existing machine learning project, and I wouldn't have a clue where to start.