Calling a Node.js script from Processing

Hi, I want to call a node.js script from within Processing on OSX.

I have tried

launch ("node test.js");

but it doesn't seem to launch.

Any idea how to make this work?

Cheers.

Phil

Answers

  • edited May 2016

    Dunno much about how to pull launch() out, sorry. :-<
    But just wanted you to know that Java already got a built-in JS interpreter called Nashorn.
    And if you got Java JDK installed, its corresponding interpreter is called "jjs.exe".

    You can take a look at my experiments w/ Nashorn below: :ar!
    https://forum.Processing.org/two/discussion/15151/how-to-convert-string-to-a-line-of-code

  • Thanks, I think my project needs to be Node due to the 3rd party packages i'm using. Good to know about the JS interpreter though.

  • Answer ✓

    You should launch the node server before the sketch, and communicate with it through HTTP, or even OSC

Sign In or Register to comment.