Course contentsShow
← JavaScript
Lesson 2520 of 2,72351. Package ManagementFree lesson

MINOR: Backward-Compatible Features

How minor versions add functionality while maintaining compatibility with existing code using your package.

MINOR: Backward-Compatible Features

What you'll learn: How minor version bumps add new functionality to a package without breaking existing code that depends on it.

The Middle Ground of Versioning

In semantic versioning (MAJOR.MINOR.PATCH), the MINOR version is your "safe expansion" number. When you increment it (e.g., from 2.3.1 to 2.4.0), you're signaling: "I've added something new, but everything that worked before still works exactly the same way."

Think of it like a restaurant adding new menu items. Existing customers can order their favorite dishes unchanged, but there are exciting new options available for those who want them.

What Qualifies as a Minor Change?

Minor changes include:

  • New functions or methods that don't alter existing ones
  • New optional parameters with sensible defaults
  • New event types emitted by an EventEmitter
  • New exported modules in your package
  • Deprecation warnings for features you plan to remove (with the feature still working)

For example, if your package exports parseData(input) and you add parseDataAsync(input), that's a minor change. Users can adopt the async version when ready, but their existing parseData calls continue working.

The Compatibility Contract

When you publish a minor version, you promise that code written against 2.3.x will run against 2.4.0 without modification. This is why lockfiles and version ranges like ^2.3.0 work—they trust minor updates won't break things.

Key Takeaway: Minor versions let you grow your package's capabilities while respecting the trust users place in stable APIs—add features freely, but never take them away or change their behavior.