Udemy
    •  
    •  
    •  
    •  
    •  
    •  
    •  
    •  
Turn what you know into an opportunity and reach millions around the world.
Learn More
Your cart is empty.
Keep shopping
Node JS Full Tutorial In Tamil
Rating: 4.4 out of 5(2 ratings)
28 students

Node JS Full Tutorial In Tamil

Learn The Most Popular Backend & Server Side Scripting Language In Tamil
Last updated 7/2024
English

What you'll learn

  • Basics of Node js, installation, and setup.
  • Understanding the event-driven architecture, asynchronous programming, and the Node js event loop.
  • Creating and deploying RESTful APIs, handling requests and responses, and working with middleware.
  • Connecting Node js applications with databases like MongoDB, MySQL, or PostgreSQL.

Course content

4 sections13 lectures4h 28m total length
  • Node JS Introduction8:29

    Node JS Introduction

    • Node.js is an open source server environment.

    • Node.js is not a programming language itself. It is a platform which runs JavaScript on server side

    • Node.js = Runtime Environment + JavaScript Library

    • Its runs on various platforms (Windows, Linux, Unix, Mac OS X, etc.)

    • Node.js has built-in libraries to handle web requests and responses so we don’t need a separate web server or other dependencies.

    How its work ?

    Extremely fast: Node.js is built on Google Chrome's V8 JavaScript Engine, its used for converting javascript code to machine code faster

    I/O Non Blocking and Asynchronous : All APIs of Node.js library are asynchronous i.e. non-blocking. So a Node.js based server never waits for an API to return data. The server moves to the next API after calling it and a notification mechanism of Events of Node.js helps the server to get a response from the previous API call. It is also a reason that it is very fast.

    Single threaded: Node.js follows a single threaded model with event looping. Node.js uses a single threaded program and the same program can provide service to a much larger number of requests than traditional servers like Apache HTTP Server.

    No buffering: Node.js cuts down the overall processing time while uploading audio and video files. Node.js applications never buffer any data. These applications simply output the data in chunks.

    PHP VS NODE

    How PHP or ASP handles a file request

    • A web server sends the task to the computer's file system and its waits untill when the file system opens and reads the file then it returns the content to the client.

    • When the task completed then only its ready to handle the next request.

    How Node.js handles a file request

    • A web server sends the task to the computer file system then immediately its ready to handle the next request. Node.js eliminates the waiting, and simply continues with the next request.

    • When the file system has opened and read the file, the server returns the content to the client.

    • Node.js can generate dynamic page content

    • Node.js can create, open, read, write, add,modify, delete, and close files on the server and database.

    Node.js doesn’t support CPU intensive work its only work on I/O intensive.



  • Node JS Installation and Environmental Setup4:19

    Environmental Setup

    • To install and setup an environment for Node.js, you need the following two softwares available on your computer

    • Text Editor ( Visual Studio Code, Notepad++ or Notepad)

    • Node.js Binary Installer.

                                                  https://nodejs.org/en/download/

    • After installation open command prompt and the below command to check the version of Node JS

                                                                      node -v

    Sample Program

    • Open your text editor and type the below code then save the file as filename.js extension.

    console.log("Hello world");

    • Open Your Command Prompt and enter the below comment

                                                                    cd desktop

                                                                 node filename.js


  • Git & GitHub Tutorial9:19
  • Node JS Modules11:48

    • Node JS Modules to be the same as JavaScript libraries.

    • Node.js has a set of built-in modules which you can use in your application without any further installation.

    • In Node JS , you can easily create your own modules and include in your application.

    • If you want to include the in-built modules or your own modules in your application then you use the require() function with the name of the module.

    Node JS Built-in Modules

    • http - To make Node.js act as an HTTP server

    • https - To make Node.js act as an HTTPS server.

    • fs - To handle the file system

    • events - To handle events

    • path - To handle file paths

    • url - To parse URL strings

  • Node JS HTTP Module11:09

    How HTTPS Works ?

    HTTP stands for Hyper Text Transfer Protocol

    WWW is about communication between web clients and servers

    • Its done by sending HTTP Requests and receiving HTTP Responses

    Client Cloud Server

    • A client (a browser) sends an HTTP request to the web

    • An web server receives the request

    • The server runs an application to process the request

    • The server returns an HTTP response (output) to the browser

    • The client (the browser) receives the response.

  • Node JS File System Module29:12

    • The Node JS file system module allows you to read, write, create, update, delete or rename the files on your computer.

    • In fs module, every method has synchronous and asynchronous.

    • Asynchronous is better than synchronous because its never block the program during execution like synchronous.

    • In Asynchronous methods take a last parameter as completion function callback.

    • Inside the callback function we pass the first parameter as err for printing the error message when the file have an error.

    • Import file system module using require keyword

                                                   var fs = require(‘fs’);

    Read File

    • fs.readFile() – Used to read the files from your computer.

    • In Node JS, Read File have both synchronous and asynchronous methods.

    • Synchronous

                                             var data = fs.readFileSync(‘demo.txt');

    • Asynchronous Parameters

    path – File name including with path

    callback - In this callback function which gets two arguments (err, data)

                                          fs.readFile(‘demo.txt', function (err, data));

    Write File

    • fs.writeFile() – If file already exists then its replaces the file content. If the file does not exist, a new file will be created and specified content should be written.

    path - File name including with path.

    data - String to be written in file.

    callback - In this callback function which gets single arguments (err) which return error in case of any error occur.

                                      fs.writeFile(‘demo.txt', ”Hello world”, function (err));

    Append File

    • fs.appendFile() – Append the specified content to a file. If file doesnot exists then its create a file and append the content.

    path - File name including with path.

    data - String to be append in file.

    callback - In this callback function which gets single arguments (err) which return error in case of any error occur.

                                    fs.appendFile(‘demo.txt', 'Hello World', function (err));


    Rename File

    • fs.rename() – This method used to rename the file

    Path 1 – existing file name including path

    Path 2 – new file name including path

    Callback – In this callback function which gets one argument (err).

    fs.rename(‘demo1.txt', ‘demo2.txt', function (err))


    • fs.unlink() – This method used to delete a file

    Path - This is string having file name including path.

    Callback - This is the callback function which gets one argument (err)

    fs.unlink(‘demo.txt', function(err))


    Open File

    • The fs.open() method takes a "flag" as the second argument. In this method, If the file does not exist, an empty file is created.

    fs.open(path, flags[, mode], callback)

    path - File name including with path.

    flags - Flag specifies the behavior of the file to be opened like read / write / append.

    mode - This sets the file mode (permission and sticky bits), but only if the file was created. It defaults to 0666, readable and writeable.

    callback – In this callback function which gets two arguments (err, fd).

    err – It returns error in case of any error occur.

    fd − This is the file descriptor returned by fs.open().

    fs.open(“demo.txt”,w+,function(err,fd))


    • Lot of Flags for Handling File System.

    Read File

    1. r - read file , if it doesn’t exist its return exception

    2. r+ - read and write

    3. rs - read in synchronous mode

    4. rs+ - read and write in synchronous mode

    Write File

    1.w - write ( if file not exist then its create a file, if it exists then the file will be truncated )

    2.wx - write ( if file exist its fail )

    3.w+ - write and read ( if file not exist then its create a file, if it exists then the file will be truncated )

    4.wx+ - write and read ( if file exist its fail )

    Append File

    1.a - appending , if file not exist then its create a file

    2.ax - appending , if file exist its fail

    3.a+ - read and append , if file not exist then its create a file

    4.ax+ - read and append , if file exist its fail

    Methods for getting file information

    1.stats.isFile() - Returns true if file type is simple file.

    2.stats.isDirectory() - Returns true if file type is directory.

    Path: This is string having file name including path.

    Callback: This is the callback function which gets two arguments (err, stats)

    • err – Its return errors in case of any error occurs

    • stats – Its an object of fs.Stats type.

    fs.stat(‘demo.txt', function (err, stats))


  • Node JS URL Module17:19

    • URL module splits up a web address into readable parts.

    • Parse an address with the url.parse() method, and it will split a URL object with each part of the address as properties

                                                 http://localhost:8080/demo.html

    Host : localhost:8080

    Path name : demo.html

    Note : Web servers usually respond with html documents along with images, style sheets and scripts.

Requirements

  • You need a node js and npm software installation in your PC

Description

Hello Guys, Now I'll give a quick intro about Node.js

Node JS Introduction

  • Node.js is an open source server environment.

  • Node.js is not a programming language itself. It is a platform which runs JavaScript on server side

  • Node.js = Runtime Environment + JavaScript Library

  • Its runs on various platforms (Windows, Linux, Unix, Mac OS X, etc.)

  • Node.js has built-in libraries to handle web requests and responses. So, we don’t need a separate web server or other dependencies.

Why we want to learn Node.js & How its work ?

  • Extremely fast: Node.js is built on Google Chrome's V8 JavaScript Engine, its used for converting javascript code to machine code faster

  • I/O Non Blocking and Asynchronous : All APIs of Node.js library are asynchronous i.e. non-blocking. So a Node.js based server never waits for an API to return data. The server moves to the next API after calling it and a notification mechanism of Events of Node.js helps the server to get a response from the previous API call. It is also a reason that it is very fast.

  • Single threaded: Node.js follows a single threaded model with event looping. Node.js uses a single threaded program and the same program can provide service to a much larger number of requests than traditional servers like Apache HTTP Server.

  • No buffering: Node.js cuts down the overall processing time while uploading audio and video files. Node.js applications never buffer any data. These applications simply output the data in chunks.

Difference Between PHP and Node.js

How PHP or ASP handles a file request

  • A web server sends the task to the computer's file system and its waits untill when the file system opens and reads the file then it returns the content to the client.

  • When the task completed then only its ready to handle the next request.

How Node.js handles a file request

  • A web server sends the task to the computer file system then immediately its ready to handle the next request. Node.js eliminates the waiting, and simply continues with the next request.

  • When the file system has opened and read the file, the server returns the content to the client.

  • Node.js can generate dynamic page content

  • Node.js can create, open, read, write, add,modify, delete, and close files on the server and database.

  • Node.js doesn’t support CPU intensive work its only work on I/O intensive.

  • In this course you will learn all the key concepts of Node.js. This course will helpful for you to develope a backend application using Nodejs. Following topics are covered in this course.

  1. Introduction

  2. How Nodejs Work

  3. Single Thread vs Multiple Thread

  4. PHP vs NodeJS

  5. Git & GitHub Tutorial

  6. Nodejs, Npm and Visual Studio Code Installation

  7. Nodejs Modules

  8. Nodejs Built-in Modules

  9. How HTTP Works?

  10. Nodejs HTTP Module

  11. Nodejs File System Module

  12. Web Application Architecture

  13. How Web Server Works?

  14. Nodejs URL Module

  15. Send Mail Using Nodejs

  16. Upload Files and Send Html Form

  17. Nodejs + MySQL

  18. MongoDB Installation and Environmetal Variable Setup

  19. Nodejs + MongoDB

  20. RESTful API

  21. JSON

  22. Express JS Installation

  23. CRUD Application

Who this course is for:

  • Anyone interested in building scalable, high-performance web applications using Node js.