npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

modern-version

v2.1.0

Published

Automated version management and CHANGELOG generation tool

Readme

modern-version

Automated Version Management and CHANGELOG Generation
A feature-rich replacement for standard-version with enhanced capabilities, full lifecycle hooks, multi-file support, and commit validation.

version GitHub license Tests codecov


✅ Recommended Commit Format

We recommend using Commitizen or git-cz to follow the Conventional Commits specification. This ensures your commit messages are parsed correctly and changelogs are generated accurately.

Install and use with:

npm install --save-dev commitizen
npx commitizen init cz-conventional-changelog --save-dev --save-exact

📦 Installation

npm install --save-dev modern-version
# or globally
npm install -g modern-version

🚀 Quick Start

  1. Add the release script to your package.json:
{
  "scripts": {
    "release": "modern-version"
  }
}
  1. Run a release:
npm run release -- --release-as minor

⚙️ Configuration

Create .versionrc.json in your project root:

Basic Example

{
  "changelog": {
    "header": "# Change History\n\n",
    "types": [
      {"type": "feat", "section": "✨ Features"},
      {"type": "fix", "section": "🐞 Bug Fixes"},
      {"type": "chore", "section": "🔧 Maintenance"},
      {"type": "docs", "section": "📚 Documentation"}
    ]
  }
}

Advanced Configuration

{
  "files": ["package.json", "manifest.json"],
  "changelog": {
    "header": "# CHANGELOG\n\n",
    "footer": "Automatically generated",
    "repositoryUrl": "https://github.com/your/repo",
    "types": [
      {"type": "feat", "section": "Features"},
      {"type": "fix", "section": "Bug Fixes"},
      {"type": "perf", "section": "Performance Improvements"},
      {"type": "revert", "section": "Reverts"}
    ],
    "skip": {
      "chore": true,
      "docs": false
    },
    "skipInvalidCommits": true
  },
  "bumpTypes": {
    "minor": ["feat"]
  },
  "scripts": {
    "prerelease": "echo 'Starting release'",
    "postchangelog": "prettier --write CHANGELOG.md"
  }
}

🛠 Complete Config Reference

| Parameter | Type | Description | Default | | ------------------------- | --------- | ------------------------------------- | ---------------------------- | | files | string[] | Files to bump version in | ["package.json"] | | commitMessage | string | Custom commit message | chore(release): v{version} | | changelog.header | string | Changelog header | "# Changelog\n\n" | | changelog.footer | string | Footer text | "" | | changelog.repositoryUrl | string | Repository URL for links | | | changelog.types | object[] | Grouping for commit types | | | changelog.skip | object | Types of commits to skip in changelog | | | bumpTypes.minor | string[] | Commit types that trigger a minor bump | ["feat", "features", "feature"] | | scripts | object | Lifecycle hook commands | |

🔄 Lifecycle Hooks

Complete list of available hooks:

| Hook | Description | Return Value | | --------------- | --------------------------- | ---------------------- | | prerelease | Before the release starts | - | | prebump | Before version bump | New version (override) | | postbump | After version bump | - | | prechangelog | Before changelog generation | - | | postchangelog | After changelog generation | - | | precommit | Before committing changes | - | | postcommit | After committing changes | - | | pretag | Before creating a Git tag | - | | posttag | After tag creation | - |

Hook Usage Example

{
  "scripts": {
    "prebump": "echo 'Current version: $VERSION'",
    "postbump": "npm run build",
    "postchangelog": "prettier --write CHANGELOG.md"
  }
}

💻 CLI Options

modern-version [options]

| Option | Description | Example | | ------------------------ | ---------------------------------------- | -------------------------- | | --release-as | Specify the release version | --release-as 1.2.3 | | --prerelease | Mark as a pre-release | --prerelease beta | | --dry-run | Run without changing anything | --dry-run | | --skip-changelog | Skip changelog generation | --skip-changelog | | --regenerate-changelog | Rebuild changelog from all version tags | --regenerate-changelog |

Automatic Bump Policy

Without --release-as, modern-version detects the bump type from commits since the last version tag:

  • A commit whose type is listed in bumpTypes.minor triggers a minor release.
  • An accepted conventional commit with !, such as fix(api)!: remove legacy endpoint, triggers a minor release regardless of its type.
  • An accepted commit with a BREAKING CHANGE: or BREAKING-CHANGE: footer triggers a minor release regardless of its type.
  • If none of these conditions match, the release is a patch.

Major releases are never detected automatically. Use --release-as major when a breaking change should produce a major release. When changelog.skipInvalidCommits is enabled, a commit must first match changelog.types; filtered commits do not affect the version or changelog.

Previously, running modern-version without release flags always selected a patch bump. CI workflows that depend on that behavior should pass --release-as patch explicitly.

Breaking Change Commits

cz-conventional-changelog records breaking changes in the commit body instead of adding ! to the header:

fix(card): align footer

BREAKING CHANGE: removed the showFooter input; use the footer slot instead

The footer is used both for bump detection and for a dedicated changelog section:

### ⚠️ Breaking Changes
- **abc1234: align footer**

  removed the showFooter input; use the footer slot instead

The commit also remains in its regular type section, such as Bug Fixes. Multiline breaking-change descriptions are preserved in the changelog.

Regenerate Changelog History

Use the version tags reachable from the current branch to rebuild the complete changelog:

modern-version --regenerate-changelog --dry-run
modern-version --regenerate-changelog

The dry run prints the rebuilt content without writing it. The second command overwrites the configured changelog file, but does not bump the package version, run release hooks, create a commit, or create a tag. Each section uses the date of its tag and the full commit body, so historical BREAKING CHANGE: footers are restored. Release commits such as chore(release): v1.2.3 are excluded.

Only tagged releases are rebuilt. The current changelog configuration controls grouping, skipped types, and section names; use the dry run to review how older commits map to the current configuration before overwriting the file.

📌 Usage Examples

Standard Release

modern-version
# or via npm
npm run release

Major Release

modern-version --release-as major

Pre-release

modern-version --prerelease beta

Skip Changelog

modern-version --skip-changelog

Specific Version

modern-version --release-as 2.1.0-rc.1

🤝 Contributing

  1. Fork the repository
  2. Install dependencies:
npm install
  1. Create a feature branch:
git checkout -b feature/new-awesome-feature
  1. Run tests:
npm test
  1. Create a Pull Request

📜 License

MIT © 2025 [RemiRRo]