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

semverflation

v1.0.7

Published

Calculate frequency of semver major bumps over time

Downloads

6

Readme

Semverflation is a software metric to track how frequently semver major of a package is bumped throughout the lifetime of the package's releases. Read the blog post.

Test

This package is an implementation to calculate semverflation in modern JavaScript runtime environments. It only concerns itself with npm packages that follow semver. It can run in your terminal. Or you can consume it as a library inside a JavaScript runtime environment like a webpage or nodejs.

Few questions that may come to your mind.

Working Demo

Try it live

You may also checkout the Codesandbox of the above deployed version.

Installation

Using package managers

# npm
npm install semverflation

# yarn
yarn add semverflation

# globally
npm install -g semverflation

Using CDNs like Skypack in HTML

<script type="module">
  import semverflation from "https://skypack.dev/semverflation";

  // more code ensues
</script>

Usage

This is a pure ECMAScript Modules package.

Evergreen browser

import semverflation from "semverflation";

// grab the npm package
const url = new URL(`https://registry.npmjs.org/react`);
const pkg = await (await fetch(url)).json();

// pass the package, get unrounded score
const score = semverflation(pkg);

// or round to 2 decimal places
const roundScore = semverflation(pkg, { decimal: 2 });

Node with node-fetch

import fetch from "node-fetch";

const url = new URL(`https://registry.npmjs.org/react`);
const pkg = await (await fetch(url)).json();

const score = semverflation(pkg);
const roundScore = semverflation(pkg, { decimal: 2 });

Terminal

With npx

npx semverflation react
29.742389879279973

Globally

Assuming, you have semverflation globally installed.

semverflation react

See help

npx semverflation --help

Usage
  $ semverflation <name>

  Options
  --decimal, -d     Number of decimal places to round to
  --help, -h        Show help
  --version, -v     Show version

  Examples
  $ semverflation react --decimal 2
  29.74

Questions

If you haven't read the post written by Zach, you should read it first.

Q. What is semver?

It's a software versioning specification. Read more.

Q. How is semverflation useful?

Semverflation is not a metric that concludes anything in of itself. A project with high or low semverflation may have multiple different reasons. Treat it as another metric along with various other ways of gauging the quality of a software package.

Q. What about browsers and other applications?

The scope of this utility is only limited to npm packages that are maintained following semver. Applications like browsers are out of scope and you would have to calculate semverflation of those manually using the formula.

Q. Why do I get not enough major versions to calculate semverfaltion error?

Semverflation looks at how many years has passed between the latest version and v1.0.0. If number of years elapsed is less than 1, it would bail out with the above error.

Q. What about packages that are yet to reach 1.0.0?

For such packages, semverflation would be calculated as 0. Try running npx semverflation axios as an example.

Issues or Questions?

Feel free to ask a question or report an issue. Open an issue

License

Code and documentation in this project are released under the MIT License.