Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

npm-script-selector

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

npm-script-selector - npm Package Compare versions

Comparing version 1.1.0 to 1.2.0

26

app.ts

@@ -10,3 +10,3 @@ #!/usr/bin/env node

import { confirm } from '@inquirer/prompts';
import { exec } from 'child_process';
import { spawn } from 'child_process';

@@ -108,10 +108,20 @@

private async runScript(scriptName: string): Promise<void> {
return new Promise<void>((resolve, reject) => {
exec(`npm run ${scriptName}`, (error, stdout, stderr) => {
if (error) {
console.error(`Error running script: ${error.message}`);
reject(error);
return new Promise((resolve, reject) => {
const child = spawn('npm', [`run ${scriptName}`], {
stdio: 'inherit', // This line makes the child process use the same stdio as the parent.
shell: true
});
child.on('error', (error) => {
console.error(`Error starting script: ${error.message}`);
reject(error);
});
child.on('exit', (code, signal) => {
if (code === 0) {
console.log(`Script exited successfully.`);
resolve();
} else {
console.log(`Script output:\n${stdout}`);
resolve();
console.error(`Script exited with code ${code} and signal ${signal}`);
reject(new Error(`Script exited with code ${code} and signal ${signal}`));
}

@@ -118,0 +128,0 @@ });

@@ -119,10 +119,18 @@ #!/usr/bin/env node

return new Promise((resolve, reject) => {
(0, child_process_1.exec)(`npm run ${scriptName}`, (error, stdout, stderr) => {
if (error) {
console.error(`Error running script: ${error.message}`);
reject(error);
const child = (0, child_process_1.spawn)('npm', [`run ${scriptName}`], {
stdio: 'inherit',
shell: true
});
child.on('error', (error) => {
console.error(`Error starting script: ${error.message}`);
reject(error);
});
child.on('exit', (code, signal) => {
if (code === 0) {
console.log(`Script exited successfully.`);
resolve();
}
else {
console.log(`Script output:\n${stdout}`);
resolve();
console.error(`Script exited with code ${code} and signal ${signal}`);
reject(new Error(`Script exited with code ${code} and signal ${signal}`));
}

@@ -129,0 +137,0 @@ });

{
"name": "npm-script-selector",
"version": "1.0.5",
"version": "1.1.0",
"description": "A CLI for finding npm scripts within a `package.json` and allowing a user to run them from the command line.",

@@ -11,3 +11,6 @@ "author": {

"homepage": "https://github.com/sundayj/npm-script-selector",
"repository": "github:sundayj/npm-script-selector",
"repository": {
"type": "git",
"url": "git+https://github.com/sundayj/npm-script-selector.git"
},
"bugs": "https://github.com/sundayj/npm-script-selector/issues",

@@ -33,3 +36,3 @@ "license": "MIT",

"bin": {
"npmss": "./dist/app.js"
"npmss": "dist/app.js"
},

@@ -36,0 +39,0 @@ "config": {

{
"name": "npm-script-selector",
"version": "1.1.0",
"version": "1.2.0",
"description": "A CLI for finding npm scripts within a `package.json` and allowing a user to run them from the command line.",

@@ -11,3 +11,6 @@ "author": {

"homepage": "https://github.com/sundayj/npm-script-selector",
"repository": "github:sundayj/npm-script-selector",
"repository": {
"type": "git",
"url": "git+https://github.com/sundayj/npm-script-selector.git"
},
"bugs": "https://github.com/sundayj/npm-script-selector/issues",

@@ -33,3 +36,3 @@ "license": "MIT",

"bin": {
"npmss": "./dist/app.js"
"npmss": "dist/app.js"
},

@@ -36,0 +39,0 @@ "config": {

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc