Security News
Introducing the Socket Python SDK
The initial version of the Socket Python SDK is now on PyPI, enabling developers to more easily interact with the Socket REST API in Python projects.
simple-update-notifier
Advanced tools
Simple update notifier to check for npm updates for cli applications
The simple-update-notifier package is designed to notify users of your Node.js application when a new version of the application is available. It is particularly useful for CLI tools where maintaining the latest version can be crucial for performance, security, or accessing new features.
Version Check and Notification
This feature automatically checks for updates against the npm registry based on the current package version and notifies the user if a newer version is available. The 'pkg' parameter should be the package.json of the application, which includes the version and name.
const simpleUpdateNotifier = require('simple-update-notifier');
simpleUpdateNotifier({pkg});
Similar to simple-update-notifier, update-notifier checks for available updates to npm packages and notifies the user. It provides more extensive configuration options, including custom messages, deferment of notification, and frequency of checks.
While not providing direct user notifications, latest-version allows you to fetch the latest version of any npm package programmatically. This can be used to inform users of updates in a more customized manner compared to simple-update-notifier.
Simple update notifier to check for npm updates for cli applications.
Checks for updates for an npm module and outputs to the command line if there is one available. The result is cached for the specified time so it doesn't check every time the app runs.
npm install simple-update-notifier
OR
yarn add simple-update-notifier
import updateNotifier from 'simple-update-notifier';
import packageJson from './package.json' assert { type: 'json' };
updateNotifier({ pkg: packageJson });
Type: object
Required
Type: string
Required
Type: string
Type: number
Default: 1000 * 60 * 60 * 24
(1 day)
How often to check for updates.
Type: boolean
Default: false
Allows notification to be shown when running as an npm script.
Type: string
Default: 'latest'
Which dist-tag to use to find the latest version.
Type: boolean
Default: false
When set, updateCheckInterval
will not be respected and a check for an update will always be performed.
Type: boolean
Default: false
When set, logs explaining the decision will be output to stderr
whenever the module opts to not print an update notification
1.1.0 (2022-11-24)
Add debug flag to simpleUpdateNotifier() (#15) Use stderr, not stdout, for notification (#16)
FAQs
Simple update notifier to check for npm updates for cli applications
The npm package simple-update-notifier receives a total of 5,277,804 weekly downloads. As such, simple-update-notifier popularity was classified as popular.
We found that simple-update-notifier demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
The initial version of the Socket Python SDK is now on PyPI, enabling developers to more easily interact with the Socket REST API in Python projects.
Security News
Floating dependency ranges in npm can introduce instability and security risks into your project by allowing unverified or incompatible versions to be installed automatically, leading to unpredictable behavior and potential conflicts.
Security News
A new Rust RFC proposes "Trusted Publishing" for Crates.io, introducing short-lived access tokens via OIDC to improve security and reduce risks associated with long-lived API tokens.