Socket
Socket
Sign inDemoInstall

@npmcli/run-script

Package Overview
Dependencies
Maintainers
6
Versions
55
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 1.6.0 to 1.7.0

21

lib/run-script-pkg.js
const makeSpawnArgs = require('./make-spawn-args.js')
const promiseSpawn = require('@npmcli/promise-spawn')
const packageEnvs = require('./package-envs.js')
const { isNodeGypPackage, defaultGypInstallScript } = require('@npmcli/node-gyp')

@@ -8,3 +9,3 @@ // you wouldn't like me when I'm angry...

const runScriptPkg = options => {
const runScriptPkg = async options => {
const {

@@ -23,7 +24,15 @@ event,

const cmd = options.cmd ? options.cmd
: pkg.scripts && pkg.scripts[event]
? pkg.scripts[event] +
args.map(a => ` ${JSON.stringify(a)}`).join('')
: null
let cmd = null
if (options.cmd) {
cmd = options.cmd
} else if (pkg.scripts && pkg.scripts[event]) {
cmd = pkg.scripts[event] + args.map(a => ` ${JSON.stringify(a)}`).join('')
} else if ( // If there is no preinstall or install script, default to rebuilding node-gyp packages.
event === 'install' &&
! pkg.scripts.install &&
! pkg.scripts.preinstall &&
await isNodeGypPackage(path)
) {
cmd = defaultGypInstallScript
}

@@ -30,0 +39,0 @@ if (!cmd)

{
"name": "@npmcli/run-script",
"version": "1.6.0",
"version": "1.7.0",
"description": "Run a lifecycle script for a package (descendant of npm-lifecycle)",

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

"dependencies": {
"@npmcli/node-gyp": "^1.0.0",
"@npmcli/promise-spawn": "^1.2.0",

@@ -25,0 +26,0 @@ "infer-owner": "^1.0.4",

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