Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

package-json

Package Overview
Dependencies
Maintainers
1
Versions
35
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

package-json - npm Package Compare versions

Comparing version 1.0.2 to 1.1.0

4

index.js

@@ -6,2 +6,4 @@ 'use strict';

module.exports = function (name, version, cb) {
var url = registryUrl(name.split('/')[0]);
if (typeof version !== 'string') {

@@ -12,3 +14,3 @@ cb = version;

got(registryUrl + encodeURIComponent(name) + '/' + version, function (err, data) {
got(url + encodeURIComponent(name) + '/' + version, function (err, data) {
if (err && err.code === 404) {

@@ -15,0 +17,0 @@ cb(new Error('Package or version doesn\'t exist'));

{
"name": "package-json",
"version": "1.0.2",
"version": "1.1.0",
"description": "Get the package.json of a package from the npm registry",

@@ -28,7 +28,9 @@ "license": "MIT",

"json",
"module"
"module",
"scope",
"scoped"
],
"dependencies": {
"got": "^2.4.0",
"registry-url": "^2.0.0"
"registry-url": "^3.0.0"
},

@@ -35,0 +37,0 @@ "devDependencies": {

@@ -22,2 +22,8 @@ # package-json [![Build Status](https://travis-ci.org/sindresorhus/package-json.svg?branch=master)](https://travis-ci.org/sindresorhus/package-json)

});
// also works with scoped packages
packageJson('@company/package', 'latest', function (err, json) {
console.log(json);
//=> { name: 'package', ... }
});
```

@@ -24,0 +30,0 @@

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc