Close Menu
Soshace Digital Blog

    Subscribe to Updates

    Get The Latest News, Updates, And Amazing Offers

    What's Hot
    Interview

    Interview with Roman

    LinkedIn

    Nurturing LinkedIn Prospects Through Consistent Engagement

    Programming

    Managing Kubernetes using Terraform

    Important Pages:
    • Home
    • About
    • Services
    • Contact Us
    • Privacy Policy
    • Terms & Conditions
    Facebook X (Twitter) Instagram LinkedIn YouTube
    Today's Picks:
    • Scaling Success: Monitoring Indexation of Programmatic SEO Content
    • Leveraging Influencers: Key Drivers in New Product Launches
    • How Privacy-First Marketing Will Transform the Industry Landscape
    • The Impact of Social Proof on Thought Leadership Marketing
    • Balancing Value-Driven Content and Promotional Messaging Strategies
    • Top Influencer Marketing Platforms to Explore in 2025
    • Emerging Trends in Marketing Automation and AI Tools for 2023
    • Strategies to Mitigate Duplicate Content in Programmatic SEO
    Wednesday, September 10
    Facebook X (Twitter) Instagram LinkedIn YouTube
    Soshace Digital Blog
    • Home
    • About
    • Services
    • Contact Us
    • Privacy Policy
    • Terms & Conditions
    Services
    • SaaS & Tech

      Maximizing Efficiency: How SaaS Lowers IT Infrastructure Costs

      August 27, 2025

      Navigating Tomorrow: Innovations Shaping the Future of SaaS

      August 27, 2025

      Maximizing Impact: Strategies for SaaS & Technology Marketing

      August 27, 2025
    • AI & Automation

      Enhancing Customer Feedback Analysis Through AI Innovations

      August 27, 2025

      Navigating the Impact of AI on SEO and Search Rankings

      August 27, 2025

      5 Automation Hacks Every Home Service Business Needs to Know

      May 3, 2025
    • Finance & Fintech

      Critical Missteps in Finance Marketing: What to Avoid

      August 27, 2025

      Analyzing Future Fintech Marketing Trends: Insights Ahead

      August 27, 2025

      Navigating the Complex Landscape of Finance and Fintech Marketing

      August 27, 2025
    • Legal & Compliance

      Exploring Thought Leadership’s Impact on Legal Marketing

      August 27, 2025

      Maximizing LinkedIn: Strategies for Legal and Compliance Marketing

      August 27, 2025

      Why Transparency Matters in Legal Advertising Practices

      August 27, 2025
    • Medical Marketing

      Enhancing Online Reputation Management in Hospitals: A Guide

      August 27, 2025

      Analyzing Emerging Trends in Health and Medical Marketing

      August 27, 2025

      Exploring Innovative Content Ideas for Wellness Blogs and Clinics

      August 27, 2025
    • E-commerce & Retail

      Strategic Seasonal Campaign Concepts for Online and Retail Markets

      August 27, 2025

      Emerging Trends in E-commerce and Retail Marketing Strategies

      August 27, 2025

      Maximizing Revenue: The Advantages of Affiliate Marketing for E-Commerce

      August 27, 2025
    • Influencer & Community

      Leveraging Influencers: Key Drivers in New Product Launches

      August 27, 2025

      Top Influencer Marketing Platforms to Explore in 2025

      August 27, 2025

      Key Strategies for Successful Influencer Partnership Negotiations

      August 27, 2025
    • Content & Leadership

      The Impact of Social Proof on Thought Leadership Marketing

      August 27, 2025

      Balancing Value-Driven Content and Promotional Messaging Strategies

      August 27, 2025

      Analyzing Storytelling’s Impact on Content Marketing Effectiveness

      August 27, 2025
    • SEO & Analytics

      Scaling Success: Monitoring Indexation of Programmatic SEO Content

      August 27, 2025

      Strategies to Mitigate Duplicate Content in Programmatic SEO

      August 27, 2025

      Effective Data Visualization Techniques for SEO Reporting

      August 27, 2025
    • Marketing Trends

      How Privacy-First Marketing Will Transform the Industry Landscape

      August 27, 2025

      Emerging Trends in Marketing Automation and AI Tools for 2023

      August 27, 2025

      Maximizing ROI: Key Trends in Paid Social Advertising

      August 27, 2025
    Soshace Digital Blog
    Blog / JavaScript / Node.js / Node.js Lessons / Node.js Lesson 5: Global modules
    Node.js

    Node.js Lesson 5: Global modules

    Mohammad Shad MirzaBy Mohammad Shad MirzaSeptember 22, 2020Updated:June 3, 2024No Comments3 Mins Read
    Facebook Twitter Pinterest Telegram LinkedIn Tumblr Email Reddit
    Node.js Lesson 5: Global modules
    Node.js Lesson 5: Global modules
    Share
    Facebook Twitter LinkedIn Pinterest Email Copy Link
    Node.js Lesson 5: Global modules
    Node.js Lesson 5: Global modules

    Hello everyone, we will learn about global modules in this lesson. We will talk about what are they, how they work, and why we need them. Let’s start.

    What are global modules

    Global modules are node packages that are installed on your system rather than your project directory. They allow us to use the package as a tool anywhere on the local computer.

    By saying global, we are talking about the scope of usage of these modules. Generally, modules are scoped inside the project directory only, it means you can’t use them outside the project. But as global modules are installed on the computer (mostly root location), they can easily be used anywhere in our system. This property of node modules can come very handy in certain situations. We will talk about those situations later in this article.

    How to install a module globally

    To make a certain package available globally, we will use the below command:

    npm install -g <package-name>

    This -g will make sure the package is installed in the system directory and thus it’s available globally. The installation of a global module is a little different from the normal one. Let’s see how.

    Where do they get installed

    Global modules are installed in the standard system directory /usr/local/lib/node_modules unlike generic installation which installs the module in the project directory.

    If you want to know what’s the root location of the global module installation, you can do so by typing this command:

    npm root -g

    This will print the location on your system where all the global modules are installed. So now we know how to install them and where they get installed. Let’s talk about why we need them.

    Read More:  23. Node.js Lessons. Domains, asynchronous try.. catch. Part 3.

    Why we need global modules

    Globally means publicly available here. There are few things that we might need to do but we certainly don’t need those package inside our project. An example could a cli tool to create a project or a tool to format the code or it can be a cli tool to generate a file.

    Remember when we typed npm init and it generated a packages.json for us. That’s a classic example of how we might use a globally available module. Some other examples could be create-react-app to create a react project, react-native-cli to create a react native project, and readme-md-generator to generate a README.md file for your

    Consider these global modules as tools for your development. It makes our job easier.

    How to check which packages are installed globally

    To know the packages installed on your computer, simply type this command in the terminal:

    npm list -g

    It will give you the list of packages that are available globally.

    That’s it for this lesson. We learned a lot of cool stuff about global modules. In the next lesson, we will talk about some most frequently used node modules and learn how to use them. Stay tuned for the next article.

    Share. Facebook Twitter Pinterest LinkedIn Tumblr Email
    Mohammad Shad Mirza
    • X (Twitter)
    • LinkedIn

    JavaScript lover working on React Native and committed to simplifying code for beginners. Apart from coding and blogging, I like spending my time sketching or writing with a cup of tea.

    Related Posts

    Mastering REST APIs: Essential Techniques for Programmers

    December 18, 2024

    Crafting Interactive User Interfaces Using JavaScript Techniques

    December 17, 2024

    Effective Strategies for Utilizing Frameworks in Web Development

    December 16, 2024

    Comments are closed.

    Stay In Touch
    • Facebook
    • Twitter
    • Pinterest
    • Instagram
    • YouTube
    • Vimeo
    Don't Miss
    JavaScript December 7, 2024

    Strategies for Developing High-Performing Project Teams

    Developing high-performing project teams requires clear communication, defined roles, and effective conflict resolution strategies. Emphasizing collaboration and continuous feedback fosters a culture of trust and accountability, driving project success.

    Create simple POS with React.js, Node.js, and MongoDB #11: CRUD with Relation

    August 5, 2020

    Real-Time Subscriptions with Vue and GraphQL

    December 16, 2020

    How to Build Real-Time Applications Using Node.js and WebSockets

    May 27, 2023

    Categories

    • AI & Automation
    • Angular
    • ASP.NET
    • AWS
    • B2B Leads
    • Beginners
    • Blogs
    • Business Growth
    • Case Studies
    • Comics
    • Consultation
    • Content & Leadership
    • CSS
    • Development
    • Django
    • E-commerce & Retail
    • Entrepreneurs
    • Entrepreneurship
    • Events
    • Express.js
    • Facebook Ads
    • Finance & Fintech
    • Flask
    • Flutter
    • Franchising
    • Funnel Strategy
    • Git
    • GraphQL
    • Home Services Marketing
    • Influencer & Community
    • Interview
    • Java
    • Java Spring
    • JavaScript
    • Job
    • Laravel
    • Lead Generation
    • Legal & Compliance
    • LinkedIn
    • Machine Learning
    • Marketing Trends
    • Medical Marketing
    • MSP Lead Generation
    • MSP Marketing
    • NestJS
    • Next.js
    • Node.js
    • Node.js Lessons
    • Paid Advertising
    • PHP
    • Podcasts
    • POS Tutorial
    • Programming
    • Programming
    • Python
    • React
    • React Lessons
    • React Native
    • React Native Lessons
    • Recruitment
    • Remote Job
    • SaaS & Tech
    • SEO & Analytics
    • Soshace
    • Startups
    • Swarm Intelligence
    • Tips
    • Trends
    • Vue
    • Wiki
    • WordPress
    Top Posts

    An Introduction to Pinia: The Alternative State Management Library for Vue.js Applications

    Vue March 29, 2023

    Forget About Auth0: Implementing Authentication with Clerk.dev in Your Next.js App

    JavaScript January 15, 2024

    React Lesson 6: CSS and Animation

    JavaScript January 4, 2020

    Effective Strategies for Managing Project Dependencies

    JavaScript November 24, 2024

    Subscribe to Updates

    Get The Latest News, Updates, And Amazing Offers

    About Us
    About Us

    Soshace Digital delivers comprehensive web design and development solutions tailored to your business objectives. Your website will be meticulously designed and developed by our team of seasoned professionals, who combine creative expertise with technical excellence to transform your vision into a high-impact, user-centric digital experience that elevates your brand and drives measurable results.

    7901 4th St N, Suite 28690
    Saint Petersburg, FL 33702-4305
    Phone: 1(877)SOSHACE

    Facebook X (Twitter) Instagram Pinterest YouTube LinkedIn
    Our Picks
    JavaScript

    JSX vs HTML: Overview + Answers to FAQs

    JavaScript

    Getting started with Next.js

    Startups

    14. Node.js Lessons. Script Debugging pt. 2

    Most Popular

    28 Sample Interview Questions for JavaScript Developers | Theory and Practice

    Interview

    Top 5 Free Website Builders in 2019

    Tips

    This Is Why Freelancing Is Not for Everyone | 5 Actual Lessons I Learned as a Freelancer

    Remote Job
    © 2025 Soshace Digital.
    • Home
    • About
    • Services
    • Contact Us
    • Privacy Policy
    • Terms & Conditions

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