0% found this document useful (0 votes)
70 views4 pages

Node Js Tutorial

This Node.js tutorial covers the basics of Node.js, including its definition, asynchronous programming, and capabilities such as database and file operations. It provides instructions for installation, setting up a development environment with VS Code, and creating servers and custom modules. Additionally, it introduces the Node Package Manager (NPM) for managing packages and includes examples for file operations and an email sender app.

Uploaded by

bankarsupriya2
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)
70 views4 pages

Node Js Tutorial

This Node.js tutorial covers the basics of Node.js, including its definition, asynchronous programming, and capabilities such as database and file operations. It provides instructions for installation, setting up a development environment with VS Code, and creating servers and custom modules. Additionally, it introduces the Node Package Manager (NPM) for managing packages and includes examples for file operations and an email sender app.

Uploaded by

bankarsupriya2
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/ 4

Node js Tutorial

Talk about javascript


1. What is node js
Node.js allows you to run JavaScript on the server
open source
Free

2. Node.js uses asynchronous programming!


Explain asynchronous programming with diagram

3. What can node js do->


Run on server so it will do all the things that other programming languages do
Db operations
File operations
Data processing
Much more

4. Installing node js:


Download node js from official
Install the setup buy doing next next and next

6. Vs code also required to write the code: go and download the vs code

7. Basic folder setup

8. Node Shell

10. Script using vs code:

Simple example
How to execute code using node js

11. Modules:

Libraries /Code already written


Http
Os
Fs
Express
Nodemon
url
Etc

require() function to import module

12. Creating simple server:

Example

13. Creating custom module:

Url module
For splitting query into readable parts

var q = url.parse(req.url, true).query;

File system module:

var fs = require('fs');

Read => readFile


fs.readFile('demofile1.html', function(err, data) {

});

Write

fs.writeFile('mynewfile3.txt', 'Hello content!', function (err) {


if (err) throw err;
console.log('Saved!');
});

Append

fs.appendFile('mynewfile1.txt', 'Hello content!', function (err) {


if (err) throw err;
console.log('Saved!');
});

Delete

fs.unlink('mynewfile2.txt', function (err) {


if (err) throw err;
console.log('File deleted!');
});

14. Node Package Manager(NPM)

Npm install package


Npm uninstall package

var uc = require('upper-case');

Nodemon
Express

Much more
15. Email Sender App

File Uploader

You might also like