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

@tabnas/semver

v0.0.11

Published

Semantic Versioning 2.0.0 (semver.org) parsing for the Tabnas parser, defined as an ABNF grammar.

Readme

@tabnas/semver

A Tabnas grammar plugin that parses Semantic Versioning 2.0.0 version strings into their five parts, exactly as the specification defines them. The parser is the specification's own grammar, compiled from ABNF by @tabnas/abnf at build time, so the plugin installs a ready rule set and needs no compiler at run time.

Install

npm install @tabnas/parser @tabnas/semver

@tabnas/parser is a peer dependency, and the only one.

One example

The plugin installs on a bare Tabnas engine:

import { Tabnas } from '@tabnas/parser'
import { Semver, compare, format } from '@tabnas/semver'

const tn = new Tabnas().use(Semver)

tn.parse('1.2.3-alpha.1+build.5')
// => { major: 1, minor: 2, patch: 3, prerelease: ['alpha', 1], build: ['build', '5'] }

compare(tn.parse('1.0.0-alpha'), tn.parse('1.0.0')) // => -1
format(tn.parse('1.2.3+sha.5114f85'))               // => '1.2.3+sha.5114f85'

Build the instance once and reuse it: installing the grammar is the expensive part.

Documentation

Full documentation follows the Diátaxis framework:

  • Tutorial. A guided first parse, start to finish.
  • How-to guide. Short recipes for individual tasks.
  • Reference. The public API, the value shape, and the complete syntax accepted.
  • Concepts. How the plugin turns the specification's grammar into a parser, and why.

For the Go port, see ../go/README.md.

Grammar

The grammar is defined in the top-level semver-grammar.abnf. gen-grammar.js (npm run gen-grammar) compiles it into semver-grammar.json, the engine's rule set, and copies that file into this package (src/semver-grammar.json) and the Go and Rust ports; the plugin installs it. embed-grammar.js embeds the ABNF text itself during the build, exported as grammar for tooling that wants it.

License

Copyright (c) 2026 Richard Rodger and other contributors, MIT License.