package-json
Advanced tools
Comparing version 1.0.1 to 1.0.2
@@ -12,3 +12,3 @@ 'use strict'; | ||
got(registryUrl + encodeURIComponent(name) + '/' + version, function (err, data) { | ||
if (err === 404) { | ||
if (err && err.code === 404) { | ||
cb(new Error('Package or version doesn\'t exist')); | ||
@@ -15,0 +15,0 @@ return; |
{ | ||
"name": "package-json", | ||
"version": "1.0.1", | ||
"version": "1.0.2", | ||
"description": "Get the package.json of a package from the npm registry", | ||
@@ -10,3 +10,3 @@ "license": "MIT", | ||
"email": "sindresorhus@gmail.com", | ||
"url": "http://sindresorhus.com" | ||
"url": "sindresorhus.com" | ||
}, | ||
@@ -32,3 +32,3 @@ "engines": { | ||
"dependencies": { | ||
"got": "^1.0.1", | ||
"got": "^2.4.0", | ||
"registry-url": "^2.0.0" | ||
@@ -35,0 +35,0 @@ }, |
@@ -8,3 +8,3 @@ # package-json [![Build Status](https://travis-ci.org/sindresorhus/package-json.svg?branch=master)](https://travis-ci.org/sindresorhus/package-json) | ||
```sh | ||
``` | ||
$ npm install --save package-json | ||
@@ -20,6 +20,2 @@ ``` | ||
packageJson('pageres', 'latest', function (err, json) { | ||
if (err) { | ||
throw err; | ||
} | ||
console.log(json); | ||
@@ -39,4 +35,9 @@ //=> { name: 'pageres', ... } | ||
## Related | ||
- [`npm-keyword`](https://github.com/sindresorhus/npm-keyword) - Get a list of npm packages with a certain keyword | ||
## License | ||
MIT © [Sindre Sorhus](http://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
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
3127
4
41
+ Addedcore-util-is@1.0.3(transitive)
+ Addedduplexify@3.7.1(transitive)
+ Addedend-of-stream@1.4.4(transitive)
+ Addedgot@2.9.2(transitive)
+ Addedinfinity-agent@2.0.3(transitive)
+ Addedinherits@2.0.4(transitive)
+ Addedis-stream@1.1.0(transitive)
+ Addedisarray@1.0.0(transitive)
+ Addedlowercase-keys@1.0.1(transitive)
+ Addednested-error-stacks@1.0.2(transitive)
+ Addedobject-assign@2.1.1(transitive)
+ Addedonce@1.4.0(transitive)
+ Addedprepend-http@1.0.4(transitive)
+ Addedprocess-nextick-args@2.0.1(transitive)
+ Addedread-all-stream@2.2.0(transitive)
+ Addedreadable-stream@2.3.8(transitive)
+ Addedsafe-buffer@5.1.2(transitive)
+ Addedstatuses@1.5.0(transitive)
+ Addedstream-shift@1.0.3(transitive)
+ Addedstring_decoder@1.1.1(transitive)
+ Addedtimed-out@2.0.0(transitive)
+ Addedutil-deprecate@1.0.2(transitive)
+ Addedwrappy@1.0.2(transitive)
- Removedgot@1.2.2(transitive)
- Removedobject-assign@1.0.0(transitive)
Updatedgot@^2.4.0