1.2.0 • Published 3 years ago

npm-tool-version-check v1.2.0

Weekly downloads
129
License
-
Repository
github
Last release
3 years ago

npm-tool-version-check

Publish a tool, but want to warn users when you publish a new version.

By default, the tool will require using interaction on the commandline to continue using outdated software

Within your tool:

import versionCheck from 'npm-tool-version-check';
const thisVersion = require('./package.json').version; // Update this to work for your package
const remoteJson = 'https://raw.githubusercontent.com/johndcarmichael/npm-tool-version-check/master/package.json'; // Update this URL to work for your package 
const packageName = 'npm-tool-version-check'; // Update this to your package name
versionCheck(thisVersion, remoteJson, packageName)
.then(() => {
  // continue with your tool
}).catch(() => {
  // log additional messaging
})

Bypass

To bypass user interaction and only display the warning to the console:

  • set the process env: npm_tool_version_check__quiet to truthy
1.2.0

3 years ago

1.1.4

3 years ago

1.1.3

3 years ago

1.1.1

4 years ago

1.1.0

4 years ago

1.1.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago

0.0.4

4 years ago

0.0.3

4 years ago

0.0.2

4 years ago

0.0.1

4 years ago