🎩 You're Invited:Meet the Socket team at Black Hat in Las Vegas, August 3-6.RSVP
Sign In

@npmcli/run-script

Package Overview
Dependencies
Maintainers
4
Versions
65
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@npmcli/run-script - npm Package Compare versions

Comparing version
10.0.4
to
11.0.0
+5
-6
lib/make-spawn-args.js

@@ -1,6 +0,5 @@

/* eslint camelcase: "off" */
const setPATH = require('./set-path.js')
const { resolve } = require('path')
let npm_config_node_gyp
let npmConfigNodeGyp

@@ -23,9 +22,9 @@ const makeSpawnArgs = options => {

// npm already pulled this from env and passes it in to options
npm_config_node_gyp = nodeGyp
npmConfigNodeGyp = nodeGyp
} else if (env.npm_config_node_gyp) {
// legacy mode for standalone user
npm_config_node_gyp = env.npm_config_node_gyp
npmConfigNodeGyp = env.npm_config_node_gyp
} else {
// default
npm_config_node_gyp = require.resolve('node-gyp/bin/node-gyp.js')
npmConfigNodeGyp = require.resolve('node-gyp/bin/node-gyp.js')
}

@@ -40,3 +39,3 @@

npm_lifecycle_script: cmd,
npm_config_node_gyp,
npm_config_node_gyp: npmConfigNodeGyp,
})

@@ -43,0 +42,0 @@

@@ -6,3 +6,2 @@ const makeSpawnArgs = require('./make-spawn-args.js')

const signalManager = require('./signal-manager.js')
const isServerPackage = require('./is-server-package.js')

@@ -41,4 +40,2 @@ const runScriptPkg = async options => {

cmd = defaultGypInstallScript
} else if (event === 'start' && await isServerPackage(path)) {
cmd = 'node server.js'
}

@@ -52,15 +49,9 @@

if (stdio === 'inherit') {
let banner
const { log, input } = require('proc-log')
if (pkg._id) {
banner = `\n> ${pkg._id} ${event}\n`
log.notice('run', `${pkg._id} ${event}`)
} else {
banner = `\n> ${event}\n`
log.notice('run', event)
}
banner += `> ${cmd.trim().replace(/\n/g, '\n> ')}`
if (args.length) {
banner += ` ${args.join(' ')}`
}
banner += '\n'
const { output, input } = require('proc-log')
output.standard(banner)
log.notice('run', `${cmd.trim()} ${args?.join(' ')}`.trim())
inputEnd = input.start()

@@ -67,0 +58,0 @@ }

const PackageJson = require('@npmcli/package-json')
const runScriptPkg = require('./run-script-pkg.js')
const validateOptions = require('./validate-options.js')
const isServerPackage = require('./is-server-package.js')

@@ -15,2 +14,2 @@ const runScript = async options => {

module.exports = Object.assign(runScript, { isServerPackage })
module.exports = runScript
{
"name": "@npmcli/run-script",
"version": "10.0.4",
"version": "11.0.0",
"description": "Run a lifecycle script for a package (descendant of npm-lifecycle)",

@@ -18,4 +18,4 @@ "author": "GitHub Inc.",

"devDependencies": {
"@npmcli/eslint-config": "^6.0.0",
"@npmcli/template-oss": "4.29.0",
"@npmcli/eslint-config": "^7.0.0",
"@npmcli/template-oss": "5.1.0",
"spawk": "^1.8.1",

@@ -25,7 +25,7 @@ "tap": "^16.0.1"

"dependencies": {
"@npmcli/node-gyp": "^5.0.0",
"@npmcli/package-json": "^7.0.0",
"@npmcli/promise-spawn": "^9.0.0",
"node-gyp": "^12.1.0",
"proc-log": "^6.0.0"
"@npmcli/node-gyp": "^6.0.0",
"@npmcli/package-json": "^8.0.0",
"@npmcli/promise-spawn": "^10.0.0",
"node-gyp": "^13.0.0",
"proc-log": "^7.0.0"
},

@@ -42,8 +42,9 @@ "files": [

"engines": {
"node": "^20.17.0 || >=22.9.0"
"node": "^22.22.2 || ^24.15.0 || >=26.0.0"
},
"templateOSS": {
"//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.",
"version": "4.29.0",
"publish": "true"
"version": "5.1.0",
"publish": "true",
"updateNpm": false
},

@@ -50,0 +51,0 @@ "tap": {

const { stat } = require('node:fs/promises')
const { resolve } = require('node:path')
module.exports = async path => {
try {
const st = await stat(resolve(path, 'server.js'))
return st.isFile()
} catch (er) {
return false
}
}