Gathering detailed insights and metrics for @oclif/plugin-warn-if-update-available
Gathering detailed insights and metrics for @oclif/plugin-warn-if-update-available
Gathering detailed insights and metrics for @oclif/plugin-warn-if-update-available
Gathering detailed insights and metrics for @oclif/plugin-warn-if-update-available
warn user if a new CLI version is available
npm install @oclif/plugin-warn-if-update-available
Module System
Min. Node Version
Typescript Support
Node Version
NPM Version
39 Stars
791 Commits
13 Forks
3 Watching
15 Branches
17 Contributors
Updated on 25 Nov 2024
TypeScript (96.1%)
JavaScript (3.11%)
Batchfile (0.8%)
Cumulative downloads
Total Downloads
Last day
-10.4%
109,005
Compared to previous day
Last week
-1.1%
654,141
Compared to previous week
Last month
2.6%
2,842,461
Compared to previous month
Last year
5.3%
34,433,121
Compared to previous year
warns if there is a newer version of CLI released
This plugin shows a warning message if a user is running an out of date CLI.
This checks the version against the npm registry asynchronously in a forked process once every 60 days by default (see Configuration for how to configure this). It then saves a version file to the cache directory that will enable the warning. The upside of this method is that it won't block a user while they're using your CLI—the downside is that it will only display after running a command that fetches the new version.
Add the plugin to your project with yarn add @oclif/plugin-warn-if-update-available
, then add it to the package.json
of the oclif CLI:
1{ 2 "name": "mycli", 3 "version": "0.0.0", 4 // ... 5 "oclif": { 6 "plugins": ["@oclif/plugin-help", "@oclif/plugin-warn-if-update-available"] 7 } 8}
In package.json
, set oclif['warn-if-update-available']
to an object with
any of the following configuration properties:
timeoutInDays
- Duration between update checks. Defaults to 60.message
- Customize update message.registry
- URL of registry. Defaults to following your .npmrc configurationauthorization
- Authorization header value for registries that require auth. Defaults to following your .npmrc configurationfrequency
- The frequency that the new version warning should be shown.frequencyUnit
- The unit of time that should be used to calculate the frequency (days
, hours
, minutes
, seconds
, milliseconds
). Defaults to minutes
.1{ 2 "oclif": { 3 "plugins": ["@oclif/plugin-warn-if-update-available"], 4 "warn-if-update-available": { 5 "timeoutInDays": 7, 6 "message": "<%= config.name %> update available from <%= chalk.greenBright(config.version) %> to <%= chalk.greenBright(latest) %>.", 7 "registry": "https://my.example.com/module/registry", 8 "authorization": "Basic <SOME READ ONLY AUTH TOKEN>" 9 } 10 } 11}
Once a new version has been found, the default behavior is to notify the user on every command execution. You can modify this by setting the frequency
and frequencyUnit
options.
Examples
Once every 10 minutes.
1{ 2 "oclif": { 3 "warn-if-update-available": { 4 "frequency": 10 5 } 6 } 7}
Once every 6 hours.
1{ 2 "oclif": { 3 "warn-if-update-available": { 4 "frequency": 6, 5 "frequencyUnit": "hours" 6 } 7 } 8}
Once a day.
1{ 2 "oclif": { 3 "warn-if-update-available": { 4 "frequency": 1, 5 "frequencyUnit": "days" 6 } 7 } 8}
Once every 30 seconds.
1{ 2 "oclif": { 3 "warn-if-update-available": { 4 "frequency": 30, 5 "frequencyUnit": "seconds" 6 } 7 } 8}
<CLI>_SKIP_NEW_VERSION_CHECK
: Skip this version check<CLI>_FORCE_VERSION_CACHE_UPDATE
: Force the version cache to update<CLI>_NEW_VERSION_CHECK_FREQ
: environment variable override for frequency
setting<CLI>_NEW_VERSION_CHECK_FREQ_UNIT
: environment variable override for frequencyUnit
settingNo vulnerabilities found.
Reason
30 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 10
Reason
no binaries found in the repo
Reason
no dangerous workflow patterns detected
Reason
license file detected
Details
Reason
0 existing vulnerabilities detected
Reason
Found 0/5 approved changesets -- score normalized to 0
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
project is not fuzzed
Details
Reason
security policy file not detected
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2024-11-18
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More