Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
23 views9 pages

Nodejs

Uploaded by

huzaifa.hanif
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
23 views9 pages

Nodejs

Uploaded by

huzaifa.hanif
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 9

Node.

js
Node. js (Node) is an open source development
platform for executing JavaScript code server-side.
How to create package.json

We create package.json file by writing


npm init.
Then we add the information if our
project in it.
Package.json are use to install packages in
it.
How to install packages for project and globally

We can install packages by writing in terminal.


npm install slugify
We can install packages globally by writing in terminal
npm i -g nodemon
What is dev dependency
When we want to use any package only during the development we save that
package as dev dependency.
npm istall --save-dev nodemon
Import and Export Feature

Export from 1st file Import into 2nd file


Node.js Modules
A set of functions you want to include in your application.
Examples of Modules are:
• https
• http
• path
• fs
To include a module, use the require() function with the name of the module.
fs module
Using fs module function.
fs module functions are used for read
and write file
Non Blocking IO Model
Node.js works on non blocking
IO model
Node.js works on non blocking io
model which means that it does not
block other content while processing
first.
Event-Driven Architecture
Node.js works on Event-Driven
Result
Architecture.

You might also like