New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

run-script-cli

Package Overview
Dependencies
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

run-script-cli - npm Package Compare versions

Comparing version
0.0.9
to
0.0.10
+3
bin/nu.mjs
#!/usr/bin/env node
'use strict';
import('../dist/nu.mjs');
'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 };
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",

@@ -46,2 +46,9 @@ <p align="center">

- Uninstall
```bash
# Uninstall script
nu react
```
## Preview

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