Close Menu
    Facebook X (Twitter) Instagram
    Oixiesoft
    • Home
    • Services
      • WordPress Malware Removal
      • Fix WordPress Errors
      • WordPress Website Development
    • Articles
    • Contact
    Oixiesoft
    Home»Tutorial»Node.js»Node.js Modules
    Node.js

    Node.js Modules

    Editorial StaffBy Editorial StaffUpdated:October 13, 2022No Comments2 Mins Read
    Share
    Facebook Twitter LinkedIn Pinterest Email

    What is a Module in Node.js?

    In Simple Words, Node.js Modules are JavaScript files which contains different functionalities in each separate files. Modules are very useful to organise the code which makes debugging or future editing very easy.

    Node.js comes with various very useful Inbuilt modules which can be used for creating different functionalities.

    Node.js Inbuilt Modules

    Node.js inbuilt modules are lightweight and inbuilt with Node.js installations. You can use these Node.js Inbuilt Modules in your app without any installation.
    Here is a list of the built-in modules of Node.js version 6.10.3:
    assert :  Provides a set of assertion tests
    buffer : To handle binary data
    child_process : To run a child process
    cluster : To split a single Node process into multiple processes
    crypto : To handle OpenSSL cryptographic functions
    dgram : Provides implementation of UDP datagram sockets
    dns : To do DNS lookups and name resolution functions
    events : To handle events
    fs : To handle the file system
    http : To make Node.js act as an HTTP server
    https : To make Node.js act as an HTTPS server.
    net : To create servers and clients
    os : Provides information about the operation system
    path : To handle file paths
    querystring : To handle URL query strings
    readline : To handle readable streams one line at the time
    stream : To handle streaming data
    string_decoder : To decode buffer objects into strings
    timers : To execute a function after a given number of milliseconds
    tls : To implement TLS and SSL protocols
    tty : Provides classes used by a text terminal
    url : To parse URL strings
    util : To access utility functions
    v8 : To access information about V8 (the JavaScript engine)
    vm : To compile JavaScript code in a virtual machine
    zlib : To compress or decompress files

    How to include Node.js Module into the app:

    We can include any of above module by using the require() function. for example:

    var http = require('http');

    We can include any of above module by this method we just need to change module name in place of http.

    This is the full code to use http module to create http server

    var http = require('http');
    
    http.createServer(function (req, res) {
       res.writeHead(200, {'Content-Type': 'text/html'});
       res.end('Hello World!');
    }).listen(8080);
    

    In Next Tutorial we will learn how to create custom module at Node.js

    Share. Facebook Twitter Pinterest LinkedIn WhatsApp Reddit Tumblr Email
    Editorial Staff

    Related Posts

    Node.js NPM

    Node.js File System Module

    Node.js Console/REPL

    • Nodejs Introduction
    • Download and Install Node.js
    • Node.js Modules
    • Node.js NPM
    • Node.js Console/REPL
    • Node.js File System Module
    Services
    • Web Development
    • Mobile Application Development
    • WordPress Malware Removal Service
    • Website Design
    • WordPress Development
    • Magento Development
    • Shopify Development
    • SEO Services
    Blog
    • How to Fix the Error Establishing a Database Connection
    • Ping List WordPress
    • How To Fix Japanese Keyword Hack
    • How to remove Malware from WordPress
    Hire Developers
    • Hire WordPress Developer
    • Hire Shopify Developer
    Contact Info
    • Oixiesoft Technologies
      A-40, Block A, I thum Tower, Sector 62, Noida
    • sales@oixiesoft.com
    • Privacy Policy
    • About Us
    • Contact Us
    © 2025 OixieSoft Technologies

    Type above and press Enter to search. Press Esc to cancel.