Socket
Socket
Sign inDemoInstall

latest-version

Package Overview
Dependencies
33
Maintainers
1
Versions
16
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 4.0.0 to 5.0.0

index.d.ts

8

index.js
'use strict';
const packageJson = require('package-json');
module.exports = (name, options) => packageJson(name.toLowerCase(), options).then(data => data.version);
const lastestVersion = async (packageName, options) => {
const {version} = await packageJson(packageName.toLowerCase(), options);
return version;
};
module.exports = lastestVersion;
module.exports.default = lastestVersion;

18

package.json
{
"name": "latest-version",
"version": "4.0.0",
"version": "5.0.0",
"description": "Get the latest version of an npm package",

@@ -13,9 +13,10 @@ "license": "MIT",

"engines": {
"node": ">=6"
"node": ">=8"
},
"scripts": {
"test": "xo && ava"
"test": "xo && ava && tsd-check"
},
"files": [
"index.js"
"index.js",
"index.d.ts"
],

@@ -33,10 +34,11 @@ "keywords": [

"dependencies": {
"package-json": "^5.0.0"
"package-json": "^6.1.0"
},
"devDependencies": {
"ava": "*",
"semver": "^5.4.1",
"ava": "^1.3.1",
"semver": "^5.6.0",
"semver-regex": "^2.0.0",
"xo": "*"
"tsd-check": "^0.3.0",
"xo": "^0.24.0"
}
}

@@ -27,3 +27,3 @@ # latest-version [![Build Status](https://travis-ci.org/sindresorhus/latest-version.svg?branch=master)](https://travis-ci.org/sindresorhus/latest-version)

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

@@ -30,0 +30,0 @@ //=> '5.5.1'

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