What are the modules in Node.js? Which are the different modules used in Node.js?

In Node.js applications, modules are like JavaScript libraries and include a set of functions. To include a module in a Node.js application, we must use the require() function with the parentheses containing the module’s name.

Node.js has several modules which are used to provide the basic functionality needed for a web application. Following is a list of some of them:

Core ModulesDescription
HTTP:The HTTP module includes classes, methods, and events to create a Node.js HTTP server.
util:The util module includes utility functions required in the application and is very useful for developers.
url:The url module is used to include the methods for URL parsing.
fs:The fs module includes events, classes, and methods to handle the file I/O operations.
stream:The stream module is used to include the methods to handle streaming data.
query string:The query string module is used to include the methods to work with a query string.
zlib:The zlib module is used to include the methods to compress or decompress the files used in an application.

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *