run-script-cli
Advanced tools
| #!/usr/bin/env node | ||
| 'use strict'; | ||
| import('../dist/nu.mjs'); |
+65
| 'use strict'; | ||
| const process = require('node:process'); | ||
| const index = require('./shared/run-script-cli.23752879.cjs'); | ||
| require('node:fs'); | ||
| require('node:path'); | ||
| require('node:util'); | ||
| require('node:child_process'); | ||
| require('node:buffer'); | ||
| require('child_process'); | ||
| require('path'); | ||
| require('fs'); | ||
| require('node:url'); | ||
| require('node:os'); | ||
| require('node:timers/promises'); | ||
| require('stream'); | ||
| require('tty'); | ||
| require('node:readline'); | ||
| require('node:tty'); | ||
| require('events'); | ||
| function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e.default : e; } | ||
| const process__default = /*#__PURE__*/_interopDefaultCompat(process); | ||
| const nuCli = async (cwd = process__default.cwd(), argv = process__default.argv) => { | ||
| try { | ||
| const agent = await index.detectAgent(cwd); | ||
| let scriptValue = ""; | ||
| if (!agent?.name) { | ||
| return process__default.exit(0); | ||
| } | ||
| if (argv?.length > 2) { | ||
| scriptValue = argv.slice(2).join(" "); | ||
| } | ||
| if (!scriptValue) { | ||
| index.oe(index.$.bold(index.$.yellow("Please enter a package name\n"))); | ||
| return; | ||
| } | ||
| if (agent.name === "bun") { | ||
| index.oe(index.$.bold(index.$.green(`bun remove ${scriptValue} | ||
| `))); | ||
| await index.execaCommand(`bun remove ${scriptValue}`, { stdio: "inherit", cwd }); | ||
| } | ||
| if (agent.name === "pnpm") { | ||
| index.oe(index.$.bold(index.$.green(`pnpm remove ${scriptValue} | ||
| `))); | ||
| await index.execaCommand(`pnpm remove ${scriptValue}`, { stdio: "inherit", cwd }); | ||
| } | ||
| if (agent.name === "npm") { | ||
| index.oe(index.$.bold(index.$.green(`npm uninstall ${scriptValue} | ||
| `))); | ||
| await index.execaCommand(`npm uninstall ${scriptValue}`, { stdio: "inherit", cwd }); | ||
| } | ||
| if (agent.name === "yarn") { | ||
| index.oe(index.$.bold(index.$.green(`yarn remove ${scriptValue} | ||
| `))); | ||
| await index.execaCommand(`yarn remove ${scriptValue}`, { stdio: "inherit", cwd }); | ||
| } | ||
| } catch { | ||
| } | ||
| }; | ||
| nuCli(); | ||
| exports.nuCli = nuCli; |
| declare const nuCli: (cwd?: string, argv?: string[]) => Promise<undefined>; | ||
| export { nuCli }; |
| declare const nuCli: (cwd?: string, argv?: string[]) => Promise<undefined>; | ||
| export { nuCli }; |
| declare const nuCli: (cwd?: string, argv?: string[]) => Promise<undefined>; | ||
| export { nuCli }; |
+59
| import process from 'node:process'; | ||
| import { d as detectAgent, o as oe, $, e as execaCommand } from './shared/run-script-cli.f5e6c5d4.mjs'; | ||
| import 'node:fs'; | ||
| import 'node:path'; | ||
| import 'node:util'; | ||
| import 'node:child_process'; | ||
| import 'node:buffer'; | ||
| import 'child_process'; | ||
| import 'path'; | ||
| import 'fs'; | ||
| import 'node:url'; | ||
| import 'node:os'; | ||
| import 'node:timers/promises'; | ||
| import 'stream'; | ||
| import 'tty'; | ||
| import 'node:readline'; | ||
| import 'node:tty'; | ||
| import 'events'; | ||
| const nuCli = async (cwd = process.cwd(), argv = process.argv) => { | ||
| try { | ||
| const agent = await detectAgent(cwd); | ||
| let scriptValue = ""; | ||
| if (!agent?.name) { | ||
| return process.exit(0); | ||
| } | ||
| if (argv?.length > 2) { | ||
| scriptValue = argv.slice(2).join(" "); | ||
| } | ||
| if (!scriptValue) { | ||
| oe($.bold($.yellow("Please enter a package name\n"))); | ||
| return; | ||
| } | ||
| if (agent.name === "bun") { | ||
| oe($.bold($.green(`bun remove ${scriptValue} | ||
| `))); | ||
| await execaCommand(`bun remove ${scriptValue}`, { stdio: "inherit", cwd }); | ||
| } | ||
| if (agent.name === "pnpm") { | ||
| oe($.bold($.green(`pnpm remove ${scriptValue} | ||
| `))); | ||
| await execaCommand(`pnpm remove ${scriptValue}`, { stdio: "inherit", cwd }); | ||
| } | ||
| if (agent.name === "npm") { | ||
| oe($.bold($.green(`npm uninstall ${scriptValue} | ||
| `))); | ||
| await execaCommand(`npm uninstall ${scriptValue}`, { stdio: "inherit", cwd }); | ||
| } | ||
| if (agent.name === "yarn") { | ||
| oe($.bold($.green(`yarn remove ${scriptValue} | ||
| `))); | ||
| await execaCommand(`yarn remove ${scriptValue}`, { stdio: "inherit", cwd }); | ||
| } | ||
| } catch { | ||
| } | ||
| }; | ||
| nuCli(); | ||
| export { nuCli }; |
+2
-2
| { | ||
| "name": "run-script-cli", | ||
| "version": "0.0.9", | ||
| "version": "0.0.10", | ||
| "license": "MIT", | ||
@@ -34,3 +34,3 @@ "main": "./dist/index.cjs", | ||
| "lint-es": "eslint --ext .ts,.tsx src --color", | ||
| "start": "esno src/ni.ts react react-dom", | ||
| "start": "esno src/nu.ts react", | ||
| "test": "vitest", | ||
@@ -37,0 +37,0 @@ "verify-commit": "verify-commit-msg", |
+7
-0
@@ -46,2 +46,9 @@ <p align="center"> | ||
| - Uninstall | ||
| ```bash | ||
| # Uninstall script | ||
| nu react | ||
| ``` | ||
| ## Preview | ||
@@ -48,0 +55,0 @@ |
Shell access
Supply chain riskThis module accesses the system shell. Accessing the system shell increases the risk of executing arbitrary code.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 6 instances in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Shell access
Supply chain riskThis module accesses the system shell. Accessing the system shell increases the risk of executing arbitrary code.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 6 instances in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
266290
1.51%23
35.29%6722
1.85%58
13.73%66
3.13%7
16.67%