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,300 points
1,623 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:)

To know more about Node JS, It's recommended to join Node JS Course today.

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

Related Questions In Others

0 votes
0 answers

How to get response from S3 getObject in Node.js?

I am attempting to get data back ...READ MORE

Apr 23, 2022 in Others by Kichu
• 19,040 points
1,883 views
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 19, 2019 in Others by Hemant Gajbe
2,613 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,460 points
1,806 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,460 points
1,150 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,790 points
1,947 views
0 votes
1 answer

Hyperledger Sawtooth vs Quorum in concurrency and speed Ask

Summary: Both should provide similar reliability of ...READ MORE

answered Sep 26, 2018 in IoT (Internet of Things) by Upasana
• 8,620 points
1,472 views
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
2,396 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 11, 2019 in Others by ArchanaNagur
• 2,360 points
998 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,360 points
885 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP