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 🙏

© 2024 – Pkg Stats / Ryan Hefner

semver-auto

v1.5.1

Published

Automate the package.json versioning by assessing changes in dependencies

Downloads

103

Readme

Semver auto in progress

Installation And Usage

npm install semver-auto --save-dev
npx semver-auto

Overview

This script addresses a common challenge in private* projects related to package versioning, specifically the absence of Semantic Versioning (also called SemVer). It is designed as a targeted response to enhancing the versioning process and overcome issues such as the default version that often arises during development. By automating version updates based on dependency changes, it not only simplifies the development process but also ensures that version numbers accurately represent the changes in project packages.

Change-Driven Versioning: The script intelligently determines the appropriate version change (major, minor, or patch) based on the nature of the changes in the dependencies. This makes versioning more reflective of the impact of updates on the project. It currently examines dependencies, devDependencies, and optionalDependencies within the package.json.

| Code status | Stage | Rule | Example version | | --------------------------------------------------- | ------------- | ------------------------------------------------------------------ | --------------- | | First release of package.json | New product | Start with 1.0.0 | 1.0.0 | | Dependency that are backward compatible bug fix | Patch release | Increment the third digit | 1.0.1 | | Dependency that are backward compatible new feature | Minor release | Increment the middle digit and reset last digit to zero | 1.1.0 | | Dependency change that break backward compatibility | Major release | Increment the first digit and reset middle and last digits to zero | 2.0.0 |

* A private Node.js project can set the "private" attribute in its package.json to true, see reference.

Options

File Location

By default, the script assumes the package.json file is located in the folder you are in. To specify a different location, utilize the -f or --file flag, indicating the path to your package.json. For example:

npx semver-auto --file <my-path/package.json>

Logging

Enhance logging capabilities with detailed insights by enabling verbose mode using the -l or --log flag. For example: f

npx semver-auto --log

Progress Bar

Enable a progress bar with the -p or --progress flag. For example:

npx semver-auto --progress

HEAD Start

In Git, "HEAD" refers to the most recent commit on the currently checked-out branch. If you've previously run semver-auto, reanalyzing all commits to determine the appropriate version may be redundant. In these cases, you can start the analysis from the latest commit on your branch to make execution faster. However, exercise caution when doing so. Enable this feature by including the -h or --head flag. For example:

npx semver-auto --head

Exiting

The script can exit with a non-zero code, signaling the need for execution before proceeding with CI/CD steps. Enable by using the -e or --exit flag. For example:

npx semver-auto --exit

Upcoming Features

  • Include the -h and --help flags.
  • Update project architecture.
  • Unit Testing integration for script reliability.
  • Incorporate flag-based logic into a dedicated file to optimize performance during regular execution.

Disclaimer

This project may not be suitable If you plan to publish your package, see reference. The most important things in your package.json are the name and version fields as they will be required.

Contributing

Contributions are welcome! If you encounter issues or have suggestions for improvement, please open an issue or submit a pull request.

License

This project is licensed under the MIT License - see the LICENSE file for details.