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

read-package-json-fast

Package Overview
Dependencies
Maintainers
9
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

read-package-json-fast - npm Package Compare versions

Comparing version 1.0.2 to 1.0.3

7

index.js

@@ -7,2 +7,3 @@ const {promisify} = require('util')

.then(data => parse(data))
.then(add_id)
.then(fixBundled)

@@ -18,2 +19,8 @@ .then(foldinOptionalDeps)

const add_id = data => {
if (data.name && data.version)
data._id = `${data.name}@${data.version}`
return data
}
const foldinOptionalDeps = data => {

@@ -20,0 +27,0 @@ const od = data.optionalDependencies

2

package.json
{
"name": "read-package-json-fast",
"version": "1.0.2",
"version": "1.0.3",
"description": "Like read-package-json, but faster",

@@ -5,0 +5,0 @@ "author": "Isaac Z. Schlueter <i@izs.me> (https://izs.me)",

@@ -37,2 +37,4 @@ # read-package-json-fast

- Fold `optionalDependencies` into `dependencies`.
- Set the `_id` property if name and version are set. (This is
load-bearing in a few places within the npm CLI.)

@@ -39,0 +41,0 @@ ## WHAT THIS MODULE DOES NOT DO

@@ -159,1 +159,6 @@ const t = require('tap')

})
t.test('set _id if name and version set', t =>
t.resolveMatch(rpj(t.testdir({
'package.json': JSON.stringify({name:'a', version: '1.2.3'}),
}) + '/package.json'), { _id: 'a@1.2.3' }))

Sorry, the diff of this file is too big to display

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