Skip to content
ADHDecode
  1. Home
  2. Articles
  3. NPM

NPM Articles

50 articles

npm Environment Variables: Inject Config at Install Time

npm environment variables let you inject configuration into your project at install time, bypassing the need for manual file management and version cont.

2 min read

npx and npm exec: Run Packages Without Installing

npx and npm exec: Run Packages Without Installing — npx and npm exec let you run Node.js packages without globally installing them, but they do more tha.

2 min read

npm fund: Understand Package Funding Messages

The npm fund command is more than just a way to see where your dependencies get their money; it's a direct line to the economic health of the open-sourc.

2 min read

npm Getting Started: Install Packages and Manage Deps

npm Getting Started: Install Packages and Manage Deps — npm is the default package manager for Node.js, and it's your primary tool for bringing in exter...

2 min read

npm Global Packages: Install and Manage CLI Tools

npm global packages are just regular npm packages, but instead of being installed locally within a project's nodemodules directory, they're installed in.

3 min read

npm install: Every Flag and Option Explained

npm install isn't just about pulling in dependencies; it's a finely tuned instrument that can dramatically affect your project's build times, security, .

4 min read

npm Lifecycle Hooks: preinstall, postinstall Explained

The most surprising thing about npm lifecycle hooks is that they're not just for running scripts after installation; they're fundamental to how npm mana.

3 min read

npm link: Test Local Packages Without Publishing

npm link lets you test local packages without publishing them to a registry. Imagine you're building a reusable component library, say my-ui-components,.

3 min read

npm package-lock.json: Lock Versions for Reproducibility

npm package-lock.json: Lock Versions for Reproducibility — package-lock.json is the unsung hero of reproducible Node.js builds, ensuring your project in...

3 min read

npm Monorepos: Lerna and Nx Workspace Setup

Setting up a monorepo with npm can feel like trying to herd cats, especially when you're juggling multiple packages that depend on each other.

2 min read

npm Offline Mode: Install Packages Without Internet

npm's offline mode lets you install packages even when you're completely disconnected from the internet, which sounds like magic but is actually a cleve.

2 min read

npm optionalDependencies: Handle Missing Platforms

npm optionalDependencies: Handle Missing Platforms — optionalDependencies in package.json are a neat trick for avoiding installation failures when a pack.

1 min read

npm outdated: Find and Update Stale Dependencies

npm outdated: Find and Update Stale Dependencies — practical guide covering npm setup, configuration, and troubleshooting with real-world examples.

3 min read

npm overrides: Force Dependency Versions Globally

The npm overrides feature lets you globally enforce specific versions of dependencies across your entire project, even if different packages in your pac.

2 min read

npm package.json: Every Field and Option Explained

npm package.json: Every Field and Option Explained — The package.json file is the beating heart of any Node.js project, but it's far more than just a dep.

3 min read

npm peerDependencies: Declare and Resolve Peer Deps

Peer dependencies are a bit of a gotcha in the JavaScript ecosystem, often leading to cryptic errors or unexpected version mismatches that feel like a b.

3 min read

npm Performance: Speed Up Install and Build Times

npm installs can feel like watching paint dry, but the actual build process after npm install is where things really drag.

2 min read

npm postinstall: Run Scripts After Package Install

npm postinstall: Run Scripts After Package Install — practical guide covering npm setup, configuration, and troubleshooting with real-world examples.

3 min read

npm prepare Hook: Build Before Publish

The prepare hook in npm is your secret weapon for ensuring that code is in its absolutely pristine, ready-to-run state before it ever gets published to .

2 min read

npm Private Registry: Configure Verdaccio or Nexus

npm private registries are your own curated, secure, and lightning-fast mirrors of the public npm registry, or even hosts for your proprietary packages.

2 min read

npm Production Workflow: Install, Build, Deploy

npm isn't just for installing dependencies; its scripts section is a powerful workflow engine that orchestrates everything from local development to pro.

2 min read

npm Behind Proxy: Configure for Corporate Networks

npm Behind Proxy: Configure for Corporate Networks — practical guide covering npm setup, configuration, and troubleshooting with real-world examples.

3 min read

npm prune: Remove Unused Dependencies

npm prune is a surprisingly powerful command for cleaning up your Node. js project, but it's not just about deleting packages

3 min read

npm Publish: Release Packages to the Registry

Publishing a package to the npm registry is how you share your JavaScript code with the world, but the process is more involved than just running npm pu.

2 min read

npm Registry Auth: Configure Tokens and .npmrc

The npm registry is a public, collaborative space, but you often need to interact with private packages or publish your own.

3 min read

npm Scoped Packages: Publish Under an Organization

npm Scoped Packages: Publish Under an Organization — practical guide covering npm setup, configuration, and troubleshooting with real-world examples.

2 min read

npm Scripts: Automate Build, Test, Deploy Tasks

npm Scripts: Automate Build, Test, Deploy Tasks — practical guide covering npm setup, configuration, and troubleshooting with real-world examples.

3 min read

npm Security: Audit, Lock, and Protect Your Stack

npm's security audits are surprisingly broad, catching vulnerabilities not just in your direct dependencies, but also in the transitive dependencies of .

2 min read

npm Test Scripts: Configure Jest for Unit Testing

You can run unit tests in your npm project using Jest, and configuring it is mostly about telling npm how to invoke Jest.

4 min read

npm Access Tokens: Manage Publish and Read Tokens

npm tokens are actually two distinct types of credentials, and conflating them is the most common way people shoot themselves in the foot.

2 min read

npm Tree Shaking: Remove Dead Code from Bundles

Tree shaking isn't about finding and deleting unused code; it's about the JavaScript engine's ability to not include code it knows it won't execute.

3 min read

npm TypeScript Publishing: Ship Type Definitions

Publishing npm packages with TypeScript definitions is surprisingly simple once you understand the core mechanism: the files and types fields in package.

3 min read

npm update: Safely Upgrade All Dependencies

npm update is a surprisingly blunt instrument, often leading to unexpected breakage because it prioritizes getting the latest version over maintaining c.

2 min read

npm Verdaccio: Self-Host a Private Registry

npm Verdaccio: Self-Host a Private Registry — practical guide covering npm setup, configuration, and troubleshooting with real-world examples.

2 min read

npm SemVer: Version Packages Correctly

npm's SemVer Semantic Versioning allows packages to declare their compatibility with other packages, but most developers treat it as a suggestion rather.

2 min read

npm vs pnpm: Performance and Disk Space Compared

The primary reason pnpm often blows npm out of the water on performance and disk space isn't a clever algorithm, but a fundamentally different approach .

3 min read

npm vs Yarn: Choose Your Package Manager

npm vs Yarn: Choose Your Package Manager — npm and Yarn are both package managers for Node.js, but they tackle the same problem with fundamenta.

4 min read

npm Workspaces: Monorepo Setup for Multiple Packages

npm workspaces let you manage multiple npm packages within a single repository, simplifying dependency management and local development.

2 min read

npm Audit: Fix Security Vulnerabilities in Dependencies

npm Audit: Fix Security Vulnerabilities in Dependencies — practical guide covering npm setup, configuration, and troubleshooting with real-world examples.

4 min read

npm Build Scripts: Configure Webpack Builds

The most surprising thing about npm build scripts is how little they have to do with npm itself. Let's see Webpack in action

3 min read

npm Bundle Size: Analyze and Reduce Package Size

The most surprising thing about npm bundle size is that the packages you install are often not what end up in your final application bundle, and the siz.

3 min read

npm Cache Management: Clear and Fix Cache Errors

Your npm install is failing because the npm CLI is trying to use corrupted or outdated package data from its local cache.

3 min read

npm ci: Reproducible Installs for Production Builds

npm ci: Reproducible Installs for Production Builds. npm ci is fundamentally a lockfile-driven installer, not a package manager in the traditional sense.

1 min read

npm in GitHub Actions: Cache and Install Efficiently

npm in GitHub Actions: Cache and Install Efficiently — practical guide covering npm setup, configuration, and troubleshooting with real-world examples.

2 min read

npm CJS vs ESM: Publish Dual-Format Packages

Publishing packages that work with both CommonJS CJS and ECMAScript Modules ESM is surprisingly straightforward once you understand how Node.

3 min read

npm Config: Every .npmrc Setting Explained

npm Config: Every .npmrc Setting Explained — npm's configuration is surprisingly dynamic, and the .npmrc file is just one piece of a much larger,.

3 min read

npm Dedupe: Remove Duplicate Dependencies

npm dedupe, despite its name, doesn't actually remove duplicate dependencies. Instead, it tries to flatten your nodemodules directory, moving packages h.

3 min read

npm Deprecate: Mark Old Package Versions

npm deprecate is a command that lets you mark older versions of your package as obsolete. Here's how it works: npm deprecate <package-name>@<version-ran.

2 min read

npm devDependencies vs dependencies: Choose Correctly

Think of dependencies as the ingredients you must have for your cake to be edible. devDependencies are the fancy decorations – nice to have for presenta.

2 min read

npm dist-tags: Manage Latest, Next, Beta Channels

npm dist-tags let you publish multiple versions of a package under different "channels" so users can opt into specific release streams.

3 min read
ADHDecode

Complex topics, finally made simple

Courses

  • Networking
  • Databases
  • Linux
  • Distributed Systems
  • Containers & Kubernetes
  • System Design
  • All Courses →

Resources

  • Cheatsheets
  • Debugging
  • Articles
  • About
  • Privacy
  • Sitemap

Connect

  • Twitter (opens in new tab)
  • GitHub (opens in new tab)

Built for curious minds. Free forever.

© 2026 ADHDecode. All content is free.

  • Home
  • Learn
  • Courses
Esc
Start typing to search all courses...
See all results →
↑↓ navigate Enter open Esc close