1.0.8 • Published 2 years ago

check-version-upgraded v1.0.8

Weekly downloads
4
License
MIT
Repository
-
Last release
2 years ago

Overview

A lightweight utility that checks whether or not a local package.json file has a higher version number than what is published to a package registry. This will prevent publishing failures that may happen later in your CI/CD pipelines.

Run

Install

npm install -g check-version-upgraded

Run

CLI

Parameters

  • package.json file path
  • Optional registry to check. The default is npmjs

Example

npx check-version-upgraded ./my-module/package.json https://registry.npmjs.org

Output

The tool will print a simple true is printed to the console standard out if the local package.json version number is greater than what is published to the registry. If the local version is less than or equal to the published version, a false is printed to the standard error stream.

Programmatic

Example

import { checkVersionUpgraded } from "check-version-upgraded";
(async () => {
  const upgraded = await checkVersionUpgraded("./package.json");
  console.log(upgraded);
})();

Output

The checkVersionUpgraded returns a Promise<boolean> indicating if the local package is upgraded.

Develop

Install Dev Dependencies

npm install

Compile

npm run build

Watch

npm run watch

Wishlist

  • Add custom result handlers instead of always returning a simple boolean or printing to the console
  • Add unit tests
  • Use awaits instead of promise chains
1.0.8

2 years ago

1.0.7

2 years ago

1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago