Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

update-check

Package Overview
Dependencies
Maintainers
6
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

update-check

Minimalistic update notifications for command line interfaces

  • 1.5.4
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1.7M
increased by8.37%
Maintainers
6
Weekly downloads
 
Created

What is update-check?

The update-check npm package is used to check for updates of a particular package. It is typically used in command-line applications to inform users when a new version of the application is available. The package provides a simple API to check a registry (like npm) for published updates.

What are update-check's main functionalities?

Check for updates

This feature allows you to check if there is an update available for a given package. You provide the current package name and version, and it returns an object with the latest version if an update is available.

const updateCheck = require('update-check');

(async () => {
  let update = await updateCheck({name: 'your-package-name', version: 'current-version'});
  if (update) {
    console.log(`Update available: ${update.latest}`);
  }
})();

Custom registry

This feature allows you to specify a custom registry URL to check for updates, which can be useful if you are using a private registry or a registry other than npm.

const updateCheck = require('update-check');

(async () => {
  let update = await updateCheck({name: 'your-package-name', version: 'current-version'}, {registryUrl: 'https://custom-registry.com'});
  if (update) {
    console.log(`Update available from custom registry: ${update.latest}`);
  }
})();

Dist-tag

This feature allows you to check for updates under a specific distribution tag. This is useful when you want to check for updates that are not necessarily the 'latest' according to semver, but are tagged differently, like 'beta' or 'next'.

const updateCheck = require('update-check');

(async () => {
  let update = await updateCheck({name: 'your-package-name', version: 'current-version', distTag: 'next'});
  if (update) {
    console.log(`Update available on dist-tag 'next': ${update.latest}`);
  }
})();

Other packages similar to update-check

Keywords

FAQs

Package last updated on 13 Apr 2020

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc