Skip to content

node training

Dinuda edited this page Mar 23, 2023 · 1 revision

Node JS training

Introduction

Node JS is a JavaScript runtime built on Chrome's V8 JavaScript engine. Node JS uses an event-driven, non-blocking I/O model that makes it lightweight and efficient. Node JS' package ecosystem, npm, is the largest ecosystem of open source libraries in the world.

Prerequisites

  • Basic knowledge of JavaScript
  • Basic knowledge of HTML and CSS
  • Basic knowledge of Git and GitHub - Github training

Why use Node JS?

  • Node JS is a JavaScript runtime built on Chrome's V8 JavaScript engine. Node JS uses an event-driven, non-blocking I/O model that makes it lightweight and efficient. Node JS' package ecosystem, npm, is the largest ecosystem of open source libraries in the world.

Engines used in Node JS

  • V8
  • IBM processors

How to use Node JS?

  • Install Node JS
sudo apt-get install nodejs

or 

go to https://nodejs.org/en/download/ and download the latest version

  • Verify the installation

node -v

  • Install npm

sudo apt-get install npm


or 

go to https://nodejs.org/en/download/ and download the latest version

  • Verify the installation

npm -v

  • Create a new project

mkdir `project name`

cd `project name`

npm init

  • Install a package

npm install `package name`

  • Run a file

node `file name`

  • Install nodemon

npm install -g nodemon

  • -g is used to install the package globally

  • Nodemon is a tool that helps develop node.js based applications by automatically restarting the node application when file changes in the directory are detected.

  • Run a file using nodemon
nodemon `file name`

Hello World

index.js


console.log("Hello World")

  • Run the file

nodemon index.js

Challenges

  • Create a new project that is a calculator

How to submit the challenge

  • Clone the repository
https://github.com/Garuk-solutions/Training-nodejs

  • Create a new branch
git checkout -b `your name`

  • Add your files
git add .

  • Commit your changes

git commit -m "your message"

  • Push your changes

git push origin `your branch name`

  • Create a pull request

Go to the repository and click on the pull request button

Resources

Clone this wiki locally