ITVoyagers has created this presentation which gives theoretical overview of Nodejs. It has following contents.
1. Introduction
2. Functions
3. Features
4. Application
5. REPL
6. Streams
7. Working
8. Example
It will help students in their last minute preparations.
This presentation covers only theoretical part of nodejs, we are working on practical concepts of nodejs, and we will publish them soon.
3. Introduction
Node.js was introduced in 2009.
Node.js provides runtime environment for server to
run JavaScript.
Node.js is an open source server environment.
It is free and runs on all the platforms out there.
Node.js is built Google Chrome’s V8 JavaScript engine.
Node.js uses asynchronous programming.
Node.js uses single-threading, non-blocking
mechanisms which makes it memory efficient.
3ITVoyagers - itvoyagers.in
4. Functions
Node.js creates dynamic responses, most often dynamic
webpage contents depending upon the client’s request.
It can perform operations like create, open, delete, read,
write and close on files in server.
It can add, delete and modify data in database.
4ITVoyagers - itvoyagers.in
5. Features
Node.js executes its code in no time, which makes it
very fast for the server.
Application developed on node.js never buffers.
Node.js is asynchronous and event driven, which
means it will never wait for API to return data, It will
move to next. Notification mechanism in node.js
helps server to get data from previousAPI.
It is single-thread model with event looping, which
makes it scalable.
5ITVoyagers - itvoyagers.in
6. Application
JSON API based application can created using
node.js.
Single page applications.
Data Intensive Real Time application
I/O bound applications.
6ITVoyagers - itvoyagers.in
7. Node.js REPL
REPL is an environment.
Read
◦ Accepts input from users and stores it in memory.
Evaluate
◦ Evaluates the input.
Print
◦ Prints the final result.
Loop
◦ Loop through above process until users stops it.
7ITVoyagers - itvoyagers.in
8. Streams
Streams are objects which allows us to read/write data
to a destination in continuous manner.There are 4 type
of it.
Readable – Used for reading.
Write – Used for writing.
Transform – Used for duplex stream where output is
computed based on input.
Duplex – Used for both read and write.
8ITVoyagers - itvoyagers.in
9. Working
Node.js file is saved using “.js” extension.
Node.js file runs on server an wait for the HTTP
request from the client.
It holds a port on which it runs and listen to client’s
requests.
It has multiple sections which get executed on bases of
client requests.
It reads the query strings and create dynamic response
page according to it and sends it.
9ITVoyagers - itvoyagers.in