This time we will create external JavaScript files to be called from the NodeJS command prompt.
Create a new JavaScript file (for instance I've created sample.js).
Add the following JavaScript lines as an example:
When we call an external file from the nodejs command prompt, it shall write “Pooff” as output.
Store this file in a close destination that is easy to access later from the command prompt. Now open the “Nodejs Command Prompt” application and call this:
Then press Enter and see what happens. For me, I get:
It's that easy to call external files with Nodejs.
Do you want a much more complicated and useful solution? The next article will be about that.