Installations
npm install @expo/plugin-warn-if-update-available
Score
48.1
Supply Chain
84.5
Quality
81.1
Maintenance
100
Vulnerability
99.3
License
Developer
oclif
Developer Guide
Module System
CommonJS
Min. Node Version
>=12.0.0
Typescript Support
Yes
Node Version
16.15.1
NPM Version
8.11.0
Statistics
39 Stars
791 Commits
13 Forks
3 Watching
15 Branches
17 Contributors
Updated on 25 Nov 2024
Languages
TypeScript (96.1%)
JavaScript (3.11%)
Batchfile (0.8%)
Total Downloads
Cumulative downloads
Total Downloads
7,449,116
Last day
-29.3%
11,109
Compared to previous day
Last week
-7.6%
84,038
Compared to previous week
Last month
4.8%
373,632
Compared to previous month
Last year
28.7%
3,392,842
Compared to previous year
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
@oclif/plugin-warn-if-update-available
warns if there is a newer version of CLI released
- @oclif/plugin-warn-if-update-available
- What is this?
- How it works
- Installation
- Configuration
- Environment Variables
- Contributing
What is this?
This plugin shows a warning message if a user is running an out of date CLI.
How it works
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.
Installation
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}
Configuration
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 tominutes
.
Example configuration
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}
Notification Frequency
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}
Environment Variables
<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 forfrequency
setting<CLI>_NEW_VERSION_CHECK_FREQ_UNIT
: environment variable override forfrequencyUnit
setting
Contributing
No 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
- Info: project has a license file: LICENSE:0
- Info: FSF or OSI recognized license: MIT License: LICENSE:0
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
- Warn: third-party GitHubAction not pinned by hash: .github/workflows/failureNotifications.yml:16: update your workflow using https://app.stepsecurity.io/secureworkflow/oclif/plugin-warn-if-update-available/failureNotifications.yml/main?enable=pin
- Warn: third-party GitHubAction not pinned by hash: .github/workflows/notify-slack-on-pr-open.yml:23: update your workflow using https://app.stepsecurity.io/secureworkflow/oclif/plugin-warn-if-update-available/notify-slack-on-pr-open.yml/main?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/onRelease.yml:20: update your workflow using https://app.stepsecurity.io/secureworkflow/oclif/plugin-warn-if-update-available/onRelease.yml/main?enable=pin
- Warn: third-party GitHubAction not pinned by hash: .github/workflows/onRelease.yml:23: update your workflow using https://app.stepsecurity.io/secureworkflow/oclif/plugin-warn-if-update-available/onRelease.yml/main?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/stale.yml:11: update your workflow using https://app.stepsecurity.io/secureworkflow/oclif/plugin-warn-if-update-available/stale.yml/main?enable=pin
- Info: 0 out of 2 GitHub-owned GitHubAction dependencies pinned
- Info: 0 out of 3 third-party GitHubAction dependencies pinned
Reason
detected GitHub workflow tokens with excessive permissions
Details
- Warn: no topLevel permission defined: .github/workflows/automerge.yml:1
- Warn: no topLevel permission defined: .github/workflows/create-github-release.yml:1
- Warn: no topLevel permission defined: .github/workflows/failureNotifications.yml:1
- Warn: no topLevel permission defined: .github/workflows/notify-slack-on-pr-open.yml:1
- Warn: no topLevel permission defined: .github/workflows/onRelease.yml:1
- Warn: no topLevel permission defined: .github/workflows/stale.yml:1
- Warn: no topLevel permission defined: .github/workflows/test.yml:1
- Info: no jobLevel write permissions found
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
project is not fuzzed
Details
- Warn: no fuzzer integrations found
Reason
security policy file not detected
Details
- Warn: no security policy file detected
- Warn: no security file to analyze
- Warn: no security file to analyze
- Warn: no security file to analyze
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
- Warn: 0 commits out of 25 are checked with a SAST tool
Score
4.8
/10
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