How to include install any library in node js application program

0 votes
Being early stage learner of Node.js I want to know how to include/install libraries in Node.js using Both ES5 and ES6.
Jul 26, 2019 in Others by code_ninja
• 6,280 points
307 views

1 answer to this question.

0 votes

Node.js is server side runtime environment that lets us use JavaScript for development of backend applications

  • Module is the only way to install any library in Node.js application
  • Basically module in Node.js is a functionality which is organised in a single or multiple JavaScript file and can be reused throughout the Node.js application
  • There are 3 categories of modules:
  1. Core modules: They are in-built and you can use them without any installation
  2. User defined modules: They are created by you and you can reuse them in rest of your application
  3. Node Package Manager: These include a group of Modules or packages, developed by other developers, which can be used in your application by installing them
  • We usually include/install a library(module) using following syntax:
  1.  ES5: var module = require('module_name')
  2.  ES6: import {module} from ‘module_name’
  • The require() function mentioned here returns an object, function, property or any other JavaScript type, depending on what is mentioned in module

I hope this clears your doubt:)

answered Jul 26, 2019 by ArchanaNagur
• 2,340 points

Related Questions In Others

0 votes
0 answers

How to handle large http response data from observer in Angular application to avoid browser crash?

Suppose we have a angular application which ...READ MORE

Apr 18, 2019 in Others by Hemant Gajbe
1,205 views
0 votes
1 answer

How to install Flutter in Windows system?

Hi@akhtar, You can follow the below-given steps to ...READ MORE

answered Jul 17, 2020 in Others by MD
• 95,300 points
533 views
0 votes
1 answer

How to install Dart in Windows system?

Hi@akhtar, Dart is the programming language used to code Flutter apps. ...READ MORE

answered Jul 21, 2020 in Others by MD
• 95,300 points
277 views
0 votes
1 answer

How to install http package in Flutter?

Hi@akhtar, HTTP package contains a set of high-level ...READ MORE

answered Jul 30, 2020 in Others by MD
• 95,300 points
723 views
0 votes
1 answer

Truffle tests not running after truffle init

This was a bug. They've fixed it. ...READ MORE

answered Sep 11, 2018 in Blockchain by Christine
• 15,830 points
680 views
0 votes
1 answer
0 votes
1 answer

How to communicate gRPC example working with Node.js?

hi.. you can read below link, it ...READ MORE

answered Dec 2, 2019 in Others by Narendra Reddy Dalli
1,252 views
0 votes
1 answer

How do I start studying Node.JS to create a restful API?

Node.js is an open source server environment ...READ MORE

answered Jun 10, 2019 in Others by ArchanaNagur
• 2,340 points
238 views
0 votes
1 answer

In order to learn Node.js, I should be familiar with which other technologies ?

I appreciate your decision, its the perfect ...READ MORE

answered Jul 31, 2019 in Others by ArchanaNagur
• 2,340 points
234 views