1. not-prerelease
Detect if the current package version, or the passed version is a prerelease
not-prerelease
Package: not-prerelease
Created by: brandonocasey
Last modified: Wed, 11 May 2022 09:37:30 GMT
Version: 1.0.1
License: Apache-2.0
Downloads: 4,711
Repository: https://github.com/brandonocasey/not-prerelease

Install

npm install not-prerelease
yarn add not-prerelease

not-prerelease

Detect if the current npm version call is a prerelease or not. That way the version
lifecycle script can do things selectively in actual releases vs prereleases, such as
update a changelog with conventional-changelog

Installation

$ npm install --save-dev not-prerelease

Then edit your package.json to have:

   "scripts": {
    "version": "not-prerelease && thing-i-dont-want-to-do-on-prerelease || is-prerelease"
  }

Now when you run:

$ npm version <major|minor|patch|prerelease>

Then thing-I-dont-want-on-prerelease won't be run during a prerelease but,
will be run done during a major, minor, or patch releases.

Other information

This package exports two binaries both of which default to looking at the version of package.json in the current directory, but they can also be passed one argument, a version to check.

  • not-prerelease
    • If the version in package.json or that was passed is a prerelease it will exit 1 (failure) otherwise it will exit 0.
  • is-prerelease
    • If the version in package.json or that was passed is a prerelease it will exit 0 (success) otherwise it will exit 1.

Dependencies

RELATED POST

10 Must-Know Windows Shortcuts That Will Save You Time

10 Must-Know Windows Shortcuts That Will Save You Time

Arrays vs Linked Lists: Which is Better for Memory Management in Data Structures?

Arrays vs Linked Lists: Which is Better for Memory Management in Data Structures?

Navigating AWS Networking: Essential Hacks for Smooth Operation

Navigating AWS Networking: Essential Hacks for Smooth Operation

Achieving Stunning Visuals with Unity's Global Illumination

Achieving Stunning Visuals with Unity's Global Illumination

Nim's Hidden Gems: Lesser-known Features for Writing Efficient Code

Nim's Hidden Gems: Lesser-known Features for Writing Efficient Code