Introduction To Node.js
New to Node.js? This article will help you to get to the basics of Node.js.
What is Node.js?
- Node.js is an open source server framework and allows you to run JavaScript on the server.
- Its almost free to use
- It can run in many platforms
- Widows
- Linux
- Mac and so on.
- Its package ecosystem is called 'npm'.
- It can generate dynamic page content
- Also can obtain the CRUD functionalities
- Very Fast.
- Good for real-time services like chats.
Lets Get started ....!
Here I use Atom as my text editor. You can download and install it.Also you should download Node.js from the Node.js Official Website .
After installing Node.js open your command prompt and type the following command to get to know the version
node -v
Now create a project folder in your root folder.
Hello World!
Now lets type our first Node.js command to print Hello World! To this open a js file called test,js in your project folder and type the following command.
console.log('Hello World!');
Now to run the file get the file path from the command line and type the following code.
node test
In here my file name is test.js. So I used test which is my file name. Then you will get an output as below.
Comments
Post a Comment