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

@npmcli/run-script

Package Overview
Dependencies
Maintainers
7
Versions
57
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.1.2 to 1.2.0

2

lib/make-spawn-args.js

@@ -14,2 +14,3 @@ const isWindows = require('./is-windows.js')

cmd,
stdioString = false,
} = options

@@ -30,2 +31,3 @@

}),
stdioString,
stdio,

@@ -32,0 +34,0 @@ cwd: path,

15

lib/promise-spawn.js

@@ -23,2 +23,11 @@ const {spawn} = require('child_process')

const stdioResult = (stdout, stderr, {stdioString}) =>
stdioString ? {
stdout: Buffer.concat(stdout).toString(),
stderr: Buffer.concat(stderr).toString(),
} : {
stdout: Buffer.concat(stdout),
stderr: Buffer.concat(stderr),
}
const promiseSpawnUid = (cmd, args, opts, extra) =>

@@ -30,4 +39,3 @@ new Promise((res, rej) => {

const reject = er => rej(Object.assign(er, {
stdout: Buffer.concat(stdout),
stderr: Buffer.concat(stderr),
...stdioResult(stdout, stderr, opts),
...extra,

@@ -44,4 +52,3 @@ }))

signal,
stdout: Buffer.concat(stdout),
stderr: Buffer.concat(stderr),
...stdioResult(stdout, stderr, opts),
...extra

@@ -48,0 +55,0 @@ }

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

args = [],
stdioString = false,
} = options

@@ -32,2 +33,3 @@

cmd,
stdioString,
}), {

@@ -34,0 +36,0 @@ event,

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

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

@@ -20,2 +20,6 @@ # @npmcli/run-script

// optional, defaults to false
// return stdout and stderr as strings rather than buffers
stdioString: true,
// optional, additional environment variables to add

@@ -69,4 +73,4 @@ // note that process.env IS inherited by default

- `signal` Process exit signal
- `stdout` Buffer of stdout data
- `stderr` Buffer of stderr data
- `stdout` stdout data (Buffer, or String when `stdioString` set to true)
- `stderr` stderr data (Buffer, or String when `stdioString` set to true)
- `path` Path to the package executing its script

@@ -96,2 +100,4 @@ - `event` Lifecycle event being run

something else, which will be run in an otherwise matching environment.
- `stdioString` Optional, defaults to `false`. Return string values for
`stderr` and `stdout` rather than Buffers.

@@ -98,0 +104,0 @@ Note that this does _not_ run pre-event and post-event scripts. The

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