You're Invited:Meet the Socket Team at RSAC and BSidesSF 2026, March 23–26.RSVP
Socket
Book a DemoSign in
Socket

@npmcli/package-json

Package Overview
Dependencies
Maintainers
6
Versions
27
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@npmcli/package-json - npm Package Compare versions

Comparing version
6.1.1
to
6.2.0
+1
-0
lib/index.js

@@ -44,2 +44,3 @@ const { readFile, writeFile } = require('node:fs/promises')

'bundleDependenciesFalse',
'fixName',
'fixNameField',

@@ -46,0 +47,0 @@ 'fixVersionField',

@@ -6,2 +6,3 @@ const valid = require('semver/functions/valid')

const { log } = require('proc-log')
const moduleBuiltin = require('node:module')

@@ -148,3 +149,3 @@ /**

// name and version are load bearing so we have to clean them up first
if (steps.includes('fixNameField') || steps.includes('normalizeData')) {
if (steps.includes('fixName') || steps.includes('fixNameField') || steps.includes('normalizeData')) {
if (!data.name && !strict) {

@@ -175,2 +176,9 @@ changes?.push('Missing "name" field was set to an empty string')

if (steps.includes('fixName')) {
// Check for conflicts with builtin modules
if (moduleBuiltin.builtinModules.includes(data.name)) {
log.warn('package-json', pkgId, `Package name "${data.name}" conflicts with a Node.js built-in module name`)
}
}
if (steps.includes('fixVersionField') || steps.includes('normalizeData')) {

@@ -177,0 +185,0 @@ // allow "loose" semver 1.0 versions in non-strict mode

+1
-1
{
"name": "@npmcli/package-json",
"version": "6.1.1",
"version": "6.2.0",
"description": "Programmatic API to update package.json",

@@ -5,0 +5,0 @@ "keywords": [