summaryrefslogtreecommitdiff
path: root/deps/npm/node_modules/pacote/lib/util/npm.js
diff options
context:
space:
mode:
Diffstat (limited to 'deps/npm/node_modules/pacote/lib/util/npm.js')
-rw-r--r--deps/npm/node_modules/pacote/lib/util/npm.js9
1 files changed, 9 insertions, 0 deletions
diff --git a/deps/npm/node_modules/pacote/lib/util/npm.js b/deps/npm/node_modules/pacote/lib/util/npm.js
new file mode 100644
index 0000000000..293695525c
--- /dev/null
+++ b/deps/npm/node_modules/pacote/lib/util/npm.js
@@ -0,0 +1,9 @@
+// run an npm command
+const spawn = require('@npmcli/promise-spawn')
+
+module.exports = (npmBin, npmCommand, cwd, extra) => {
+ const isJS = npmBin.endsWith('.js')
+ const cmd = isJS ? process.execPath : npmBin
+ const args = (isJS ? [npmBin] : []).concat(npmCommand)
+ return spawn(cmd, args, { cwd, stdioString: true }, extra)
+}