@npmcli/run-script
Advanced tools
Comparing version 1.3.1 to 1.4.0
const makeSpawnArgs = require('./make-spawn-args.js') | ||
const promiseSpawn = require('@npmcli/promise-spawn') | ||
const banner = (id, event, cmd) =>`> ${id ? id + ' ' : ''}${event}\n> ${cmd}` | ||
// you wouldn't like me when I'm angry... | ||
const bruce = (id, event, cmd) =>`\n> ${id ? id + ' ' : ''}${event}\n> ${cmd}\n` | ||
@@ -16,2 +17,4 @@ const runScriptPkg = options => { | ||
stdioString = false, | ||
// note: only used when stdio:inherit | ||
banner = true, | ||
} = options | ||
@@ -28,5 +31,5 @@ | ||
if (stdio === 'inherit') { | ||
if (stdio === 'inherit' && banner !== false) { | ||
// we're dumping to the parent's stdout, so print the banner | ||
console.log(banner(pkg._id, event, cmd)) | ||
console.log(bruce(pkg._id, event, cmd)) | ||
} | ||
@@ -33,0 +36,0 @@ |
{ | ||
"name": "@npmcli/run-script", | ||
"version": "1.3.1", | ||
"version": "1.4.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)", |
@@ -45,2 +45,8 @@ # @npmcli/run-script | ||
stdio: 'inherit', | ||
// print the package id and script, and the command to be run, like: | ||
// > somepackage@1.2.3 postinstall | ||
// > make all-the-things | ||
// Defaults true when stdio:'inherit', otherwise suppressed | ||
banner: true, | ||
}) | ||
@@ -108,2 +114,6 @@ .then(({ code, signal, stdout, stderr, pkgid, path, event, script }) => { | ||
`stderr` and `stdout` rather than Buffers. | ||
- `banner` Optional, defaults to `true`. If the `stdio` option is set to | ||
`'inherit'`, then print a banner with the package name and version, event | ||
name, and script command to be run. Set explicitly to `false` to disable | ||
for inherited stdio. | ||
@@ -110,0 +120,0 @@ Note that this does _not_ run pre-event and post-event scripts. The |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
12640
158
147