Let’s get started with writing our very first Node.js program. But, what is a Node.js program? Simple, some JavaScript!
console.log('hello world')
Ok, this is cool, but now what? How do we go about executing this code? We can use the Node CLI for this. In your terminal, run:
node index.js
By use the Node CLI, we can then execute a JavaScript file by using path to that file. That’s it! You’ve created your first JavaScript program. If you did this right, you’ll see hello world in the terminal, which in Node.js, is the console.