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

@kurone-kito/is-prerelease

v0.1.0-alpha.1

Published

The simple CLI app based on Node.js that determines whether the project is a pre-release version

Downloads

176

Readme

🆕 @kurone-kito/is-prerelease

A simple CLI app based on Node.js that determines whether a given version is a pre-release version using semver.

Features

  • Detects pre-release versions (e.g., 1.0.0-alpha.1, 2.0.0-beta.3)
  • Returns exit codes for easy CI/CD integration
  • Zero configuration required

Requirements

  • Node.js ^20.11 || ^22 || >=24

Installation

npm i -D @kurone-kito/is-prerelease

Usage

Command Syntax

is-prerelease <version> [pre]

Arguments

| Argument | Required | Description | | --------- | -------- | ------------------------------------------------------------------------------- | | version | Yes | The version string to check (JSON format, e.g., "1.0.0" or "1.0.0-alpha.1") | | pre | No | If provided, the command expects a pre-release version |

Exit Codes

| Condition | Exit Code | | ------------------------------------------------------ | ------------- | | Pre-release version and pre argument provided | 0 (success) | | Stable version and pre argument not provided | 0 (success) | | Otherwise | 1 (failure) |

Examples

Check if a version is a pre-release

# Returns exit code 0 if pre-release
is-prerelease '"1.0.0-alpha.1"' pre

# Returns exit code 0 if stable release
is-prerelease '"1.0.0"'

Integration with npm scripts

{
  "scripts": {
    "is:prerelease": "is-prerelease $(npm pkg get version) pre",
    "is:release": "is-prerelease $(npm pkg get version)"
  }
}

Note: npm pkg get version outputs a JSON-formatted string (e.g., "1.0.0"), which is the expected input format.

CI/CD Usage Example

# Publish to npm only if it's a pre-release version
if npm run is:prerelease; then
  npm publish --tag next
fi

# Publish to npm only if it's a stable release
if npm run is:release; then
  npm publish --tag latest
fi

How It Works

This CLI uses the prerelease() function from the semver package to detect pre-release identifiers in version strings.

  • 1.0.0 → Stable release (no pre-release identifier)
  • 1.0.0-alpha.1 → Pre-release (identifier: ['alpha', 1])
  • 2.0.0-beta.3 → Pre-release (identifier: ['beta', 3])

Contributing

Welcome to contribute to this repository! For more details, please refer to CONTRIBUTING.md.

License

MIT