Wolfram Language

Evaluate NodeJS in a Notebook

Use NodeJS to extend the abilities of the Wolfram Language. NodeJS is great for event-driven I/O, and one example here is creating a local server and sending a request to it. The Wolfram Notebook interface includes external language cells, which can be created by typing > (the "greater than" key on your keyboard) and clicking the program icon to switch to a NodeJS cell.

Compute a specific modulus for a range of numbers, with NodeJS.

Compare with the Wolfram Language.

Set up a minimal NodeJS server listening on localhost port 7777 that will write a short message to connecting clients.

Send an asynchronous request to the server set up on localhost, and save the result in a variable.

A second evaluation of the variable will show that the asynchronous request is completed.

Related Examples

ja