1. simple-update-notifier
Simple update notifier to check for npm updates for cli applications
simple-update-notifier
Package: simple-update-notifier
Created by: alexbrazier
Last modified: Sun, 10 Sep 2023 18:41:40 GMT
Version: 2.0.0
License: MIT
Downloads: 25,924,267
Repository: https://github.com/alexbrazier/simple-update-notifier

Install

npm install simple-update-notifier
yarn add simple-update-notifier

simple-update-notifier GitHub stars

CI
Dependencies
npm
npm bundle size
npm downloads
License

Simple update notifier to check for npm updates for cli applications.

Demo in terminal showing an update is required

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.

Install

 npm install simple-update-notifier
OR
yarn add simple-update-notifier

Usage

 import updateNotifier from 'simple-update-notifier';
import packageJson from './package.json' assert { type: 'json' };

updateNotifier({ pkg: packageJson });

Options

pkg

Type: object

name

Required
Type: string

version

Required
Type: string

updateCheckInterval

Type: number
Default: 1000 * 60 * 60 * 24 (1 day)

How often to check for updates.

shouldNotifyInNpmScript

Type: boolean
Default: false

Allows notification to be shown when running as an npm script.

distTag

Type: string
Default: 'latest'

Which dist-tag to use to find the latest version.

alwaysRun

Type: boolean
Default: false

When set, updateCheckInterval will not be respected and a check for an update will always be performed.

debug

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

Dependencies

RELATED POST

10 Must-Know Windows Shortcuts That Will Save You Time

10 Must-Know Windows Shortcuts That Will Save You Time

Arrays vs Linked Lists: Which is Better for Memory Management in Data Structures?

Arrays vs Linked Lists: Which is Better for Memory Management in Data Structures?

Navigating AWS Networking: Essential Hacks for Smooth Operation

Navigating AWS Networking: Essential Hacks for Smooth Operation

Achieving Stunning Visuals with Unity's Global Illumination

Achieving Stunning Visuals with Unity's Global Illumination

Nim's Hidden Gems: Lesser-known Features for Writing Efficient Code

Nim's Hidden Gems: Lesser-known Features for Writing Efficient Code