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

semver.cxx

v1.2025.8

Published

Semantic Versioning for modern C++; Daniil Goncharov (2018).

Downloads

196

Readme

Github releases Vcpkg package Conan package License

C++ library compare and manipulate versions are available as extensions to the <major>.<minor>.<patch>-<prerelease_tag>+<build_metadata> format complying with Semantic Versioning 2.0.0

Features & Examples

  • Parse

    semver::version v1;
    if (semver::parse("1.4.3", v1)) {
      const int patch = v1.patch(); // 3
      // do something...
    }
    
    semver::version v2;
    if (semver::parse("1.2.4-alpha.10")) {
      const std::string prerelease_tag = v2.prerelease_tag() // alpha.10
      // do something...
    }
  • Сomparison

    assert(v1 != v2);
    assert(v1 > v2);
    assert(v1 >= v2);
    assert(v2 < v1);
    assert(v2 <= v1);
  • Validate

    const bool result = semver::valid("1.2.3-alpha+build");
    assert(result);
  • Range matching

    semver::range_set range;
    if (semver::parse(">=1.0.0 <2.0.0 || >3.2.1", range)) {
      semver::version version;
      if (semver::parse("1.2.3", version)) {
        assert(range.contains(version));
      }
    }

Check the examples folder to see more various usage examples

Installation

Run:

$ npm i semver.cxx

And then include semver.hpp as follows:

// main.cxx
#include <semver.hpp>

int main() { /* ... */ }

Finally, compile while adding the path node_modules/semver.cxx to your compiler's include paths.

$ clang++ -std=c++17 -I./node_modules/semver.cxx main.cxx  # or, use g++
$ g++     -std=c++17 -I./node_modules/semver.cxx main.cxx

You may also use a simpler approach with the cpoach tool, which automatically adds the necessary include paths of all the installed dependencies for your project.

$ cpoach clang++ -std=c++17 main.cxx  # or, use g++
$ cpoach g++     -std=c++17 main.cxx

Alternatively, you should add required file semver.hpp.

If you are using vcpkg on your project for external dependencies, then you can use the neargye-semver.

If you are using Conan to manage your dependencies, merely add neargye-semver/x.y.z to your conan's requires, where x.y.z is the release version you want to use.

Alternatively, you can use something like CPM which is based on CMake's Fetch_Content module.

CPMAddPackage(
    NAME semver
    GITHUB_REPOSITORY Neargye/semver
    GIT_TAG x.y.z # Where `x.y.z` is the release version you want to use.
)

Compiler compatibility

  • Clang/LLVM >= 5
  • MSVC++ >= 14.11 / Visual Studio >= 2017
  • Xcode >= 10
  • GCC >= 7

Licensed under the MIT License

SRC ORG