Getting Started with Node.js
- π To get started with Node.js, create a new file called
index.js
and add the code console.log('Hello World')
.
- π Run the code using the command
node index.js
or node .
if you're in the same directory.
- π Node.js has a built-in REPL (Read-Eval-Print Loop) mode that allows you to execute JavaScript code in real-time.
Understanding the Node.js Runtime
- π€ Node.js has a handful of built-in identifiers, including
console
, global
, and process
.
- π The
global
object is a namespace that is available throughout the entire Node.js process.
- π The
process
object gives you access to the currently running Node.js process and allows you to check the current platform, operating system, and environment variables.