@poi/cli-utils
Advanced tools
+18
| const { spawn } = require('croatia') | ||
| module.exports = (cmd, args, opts) => { | ||
| return spawn( | ||
| cmd, | ||
| args, | ||
| Object.assign({}, opts, { | ||
| env: Object.assign( | ||
| { | ||
| // Enable colors in chalk | ||
| FORCE_COLOR: true | ||
| }, | ||
| process.env, | ||
| opts && opts.env | ||
| ) | ||
| }) | ||
| ) | ||
| } |
+16
-19
| const chalk = require('chalk') | ||
| const execute = require('./execute') | ||
| const spawn = require('./spawn') | ||
| const getNpmClient = require('./get-npm-client') | ||
| const spinner = require('./spinner') | ||
@@ -9,24 +8,22 @@ module.exports = async ({ cwd, deps, saveDev }) => { | ||
| spinner.start( | ||
| `Installing dependencies ${ | ||
| deps ? deps.map(v => chalk.cyan(v)).join(', ') + ' ' : '' | ||
| }with ${pm}...` | ||
| ) | ||
| const args = deps ? ['add'].concat(deps) : ['install'] | ||
| const devFlags = saveDev ? (pm === 'yarn' ? ['--dev'] : ['-D']) : [] | ||
| try { | ||
| await execute(pm, args.concat(devFlags), { | ||
| cwd, | ||
| stdio: 'ignore' | ||
| }) | ||
| spinner.succeed( | ||
| `Installed dependencies ${ | ||
| const cp = await spawn(pm, args.concat(devFlags), { | ||
| cwd, | ||
| banner: chalk.bold( | ||
| `${chalk.cyan('===>')} Installing dependencies ${ | ||
| deps ? deps.map(v => chalk.cyan(v)).join(', ') + ' ' : '' | ||
| }` | ||
| }with ${pm}...` | ||
| ) | ||
| } catch (err) { | ||
| spinner.fail(err.message) | ||
| process.exitCode = 1 | ||
| }) | ||
| if (cp.exitCode !== 0) { | ||
| console.log( | ||
| chalk.red( | ||
| `The command '${cp.spawnargs.join( | ||
| ' ' | ||
| )}' has failed, you can run it youself later.` | ||
| ) | ||
| ) | ||
| process.exitCode = cp.exitCode | ||
| } | ||
| } |
+4
-5
| { | ||
| "name": "@poi/cli-utils", | ||
| "version": "11.0.0-alpha.9", | ||
| "version": "11.0.0-alpha.10", | ||
| "publishConfig": { | ||
@@ -12,7 +12,6 @@ "access": "public" | ||
| "command-exists": "^1.2.7", | ||
| "cross-spawn": "^6.0.5", | ||
| "joycon": "^2.1.2", | ||
| "ora": "^3.0.0" | ||
| "croatia": "^1.0.3", | ||
| "joycon": "^2.1.2" | ||
| }, | ||
| "gitHead": "7229e823a5d28bf7f6bef787ec120361c03decbf" | ||
| "gitHead": "ad5f480da011a9d73afe18be084a4bae25884d5a" | ||
| } |
-24
| const spawn = require('cross-spawn') | ||
| module.exports = (cmd, args, opts) => { | ||
| return new Promise((resolve, reject) => { | ||
| const ps = spawn( | ||
| cmd, | ||
| args, | ||
| Object.assign( | ||
| { | ||
| stdio: 'inherit' | ||
| }, | ||
| opts | ||
| ) | ||
| ) | ||
| ps.on('close', code => { | ||
| if (code !== 0) | ||
| return reject( | ||
| new Error(`The command "${ps.spawnargs.join(' ')}" has failed.`) | ||
| ) | ||
| resolve() | ||
| }) | ||
| }) | ||
| } |
| const ora = require('ora') | ||
| module.exports = ora() |
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
4
-20%1926
-10.46%4
-20%58
-13.43%2
100%+ Added
+ Added
+ Added
+ Added
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed