Socket
Socket
Sign inDemoInstall

latest-version

Package Overview
Dependencies
53
Maintainers
1
Versions
16
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 3.1.0 to 4.0.0

2

index.js
'use strict';
const packageJson = require('package-json');
module.exports = name => packageJson(name.toLowerCase()).then(data => data.version);
module.exports = (name, options) => packageJson(name.toLowerCase(), options).then(data => data.version);
{
"name": "latest-version",
"version": "3.1.0",
"description": "Get the latest version of an npm package",
"license": "MIT",
"repository": "sindresorhus/latest-version",
"author": {
"name": "Sindre Sorhus",
"email": "sindresorhus@gmail.com",
"url": "sindresorhus.com"
},
"engines": {
"node": ">=4"
},
"scripts": {
"test": "xo && ava"
},
"files": [
"index.js"
],
"keywords": [
"latest",
"version",
"npm",
"pkg",
"package",
"package.json",
"current",
"module"
],
"dependencies": {
"package-json": "^4.0.0"
},
"devDependencies": {
"ava": "*",
"semver-regex": "^1.0.0",
"xo": "*"
}
"name": "latest-version",
"version": "4.0.0",
"description": "Get the latest version of an npm package",
"license": "MIT",
"repository": "sindresorhus/latest-version",
"author": {
"name": "Sindre Sorhus",
"email": "sindresorhus@gmail.com",
"url": "sindresorhus.com"
},
"engines": {
"node": ">=6"
},
"scripts": {
"test": "xo && ava"
},
"files": [
"index.js"
],
"keywords": [
"latest",
"version",
"npm",
"pkg",
"package",
"package.json",
"current",
"module"
],
"dependencies": {
"package-json": "^5.0.0"
},
"devDependencies": {
"ava": "*",
"semver": "^5.4.1",
"semver-regex": "^2.0.0",
"xo": "*"
}
}

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

```
$ npm install --save latest-version
$ npm install latest-version
```

@@ -21,11 +21,13 @@

latestVersion('ava').then(version => {
console.log(version);
(async () => {
console.log(await latestVersion('ava'));
//=> '0.18.0'
});
latestVersion('@sindresorhus/df').then(version => {
console.log(version);
console.log(await latestVersion('@sindresorhus/df'));
//=> '1.0.1'
});
// Also works with dist-tags and semver ranges
console.log(await latestVersion('npm', {version: 'latest-5'}));
//=> '5.5.1'
})();
```

@@ -32,0 +34,0 @@

Sorry, the diff of this file is not supported yet

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