latest-version
Advanced tools
Comparing version 2.0.0 to 3.0.0
'use strict'; | ||
var packageJson = require('package-json'); | ||
const packageJson = require('package-json'); | ||
module.exports = function (name) { | ||
return packageJson(name.toLowerCase(), 'latest').then(function (data) { | ||
return data.version; | ||
}); | ||
}; | ||
module.exports = name => packageJson(name.toLowerCase(), 'latest').then(data => data.version); |
{ | ||
"name": "latest-version", | ||
"version": "2.0.0", | ||
"description": "Get the latest version of a npm package", | ||
"version": "3.0.0", | ||
"description": "Get the latest version of an npm package", | ||
"license": "MIT", | ||
@@ -13,3 +13,3 @@ "repository": "sindresorhus/latest-version", | ||
"engines": { | ||
"node": ">=0.10.0" | ||
"node": ">=4" | ||
}, | ||
@@ -33,13 +33,9 @@ "scripts": { | ||
"dependencies": { | ||
"package-json": "^2.0.0" | ||
"package-json": "^3.0.0" | ||
}, | ||
"devDependencies": { | ||
"ava": "*", | ||
"semver-regex": "^1.0.0", | ||
"xo": "*" | ||
}, | ||
"xo": { | ||
"ignores": [ | ||
"test.js" | ||
] | ||
} | ||
} |
# latest-version [![Build Status](https://travis-ci.org/sindresorhus/latest-version.svg?branch=master)](https://travis-ci.org/sindresorhus/latest-version) | ||
> Get the latest version of a npm package | ||
> Get the latest version of an npm package | ||
@@ -22,3 +22,3 @@ Fetches the version directly from the registry instead of depending on the massive [npm](https://github.com/npm/npm/blob/8b5e7b6ae5b4cd2d7d62eaf93b1428638b387072/package.json#L37-L85) module like the [latest](https://github.com/bahamas10/node-latest) module does. | ||
console.log(version); | ||
//=> '0.2.0' | ||
//=> '0.18.0' | ||
}); | ||
@@ -41,2 +41,2 @@ | ||
MIT © [Sindre Sorhus](http://sindresorhus.com) | ||
MIT © [Sindre Sorhus](https://sindresorhus.com) |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Trivial Package
Supply chain riskPackages less than 10 lines of code are easily copied into your own project and may not warrant the additional supply chain risk of an external dependency.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Trivial Package
Supply chain riskPackages less than 10 lines of code are easily copied into your own project and may not warrant the additional supply chain risk of an external dependency.
Found 1 instance in 1 package
3028
3
3
+ Addedduplexer3@0.1.5(transitive)
+ Addedget-stream@3.0.0(transitive)
+ Addedgot@6.7.1(transitive)
+ Addedpackage-json@3.1.0(transitive)
+ Addedsafe-buffer@5.2.1(transitive)
+ Addedtimed-out@4.0.1(transitive)
+ Addedunzip-response@2.0.1(transitive)
- Removedcore-util-is@1.0.3(transitive)
- Removedduplexer2@0.1.4(transitive)
- Removederror-ex@1.3.2(transitive)
- Removedgot@5.7.1(transitive)
- Removedinherits@2.0.4(transitive)
- Removedis-arrayish@0.2.1(transitive)
- Removedisarray@1.0.0(transitive)
- Removednode-status-codes@1.0.0(transitive)
- Removedobject-assign@4.1.1(transitive)
- Removedpackage-json@2.4.0(transitive)
- Removedparse-json@2.2.0(transitive)
- Removedpinkie@2.0.4(transitive)
- Removedpinkie-promise@2.0.1(transitive)
- Removedprocess-nextick-args@2.0.1(transitive)
- Removedread-all-stream@3.1.0(transitive)
- Removedreadable-stream@2.3.8(transitive)
- Removedsafe-buffer@5.1.2(transitive)
- Removedstring_decoder@1.1.1(transitive)
- Removedtimed-out@3.1.3(transitive)
- Removedunzip-response@1.0.2(transitive)
- Removedutil-deprecate@1.0.2(transitive)
Updatedpackage-json@^3.0.0