Socket
Socket
Sign inDemoInstall

latest-version

Package Overview
Dependencies
18
Maintainers
1
Versions
16
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

latest-version

Get the latest version of an npm package


Version published
Maintainers
1
Weekly downloads
6,434,411
increased by2.41%
Install size
500 kB

Weekly downloads

Readme

Source

latest-version

Get the latest version of an npm package

Fetches the version directly from the registry instead of depending on the massive npm module like the latest module does.

Install

npm install latest-version

Usage

import latestVersion from 'latest-version';

console.log(await latestVersion('ava'));
//=> '6.1.1'

console.log(await latestVersion('@sindresorhus/df'));
//=> '4.0.0'

// Also works with semver ranges and dist-tags
console.log(await latestVersion('npm', {version: 'latest-5'}));
//=> '5.10.0'

This package exposes the version, registryUrl, and omitDeprecated options from package-json, as well as the PackageNotFoundError and VersionNotFoundError errors.

Keywords

FAQs

Last updated on 27 Feb 2024

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc