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.0.3 to 1.0.5

assets/run-screenshot-20231023.jpg

30

dist/app.js

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

ProgramName: 'NPM Script Selector',
Version: '1.0.3',
Version: '1.0.5',
Description: 'A CLI for finding npm scripts within a package and allowing a user to run them from the command line.',

@@ -35,3 +35,2 @@ Options: {

};
console.log(figlet.textSync(DEFAULTS.ProgramName, { font: 'Pagga' }));
export function selectAndRunScript(filePath) {

@@ -69,7 +68,24 @@ return __awaiter(this, void 0, void 0, function* () {

export function runProgram(filePath) {
if (!fs.existsSync(filePath)) {
console.error(`${DEFAULTS.ErrorMessages.FileNotFound} ${filePath}`);
process.exit(1);
}
selectAndRunScript(filePath);
return __awaiter(this, void 0, void 0, function* () {
console.log(figlet.textSync(DEFAULTS.ProgramName, { font: 'Pagga' }));
console.log(); // Put some spacing between the title and output
if (!fs.existsSync(filePath)) {
console.error(`${DEFAULTS.ErrorMessages.FileNotFound} ${filePath}`);
process.exit(1);
}
let continueRunning = true;
while (continueRunning) {
yield selectAndRunScript(filePath);
const answer = yield inquirer.prompt([
{
type: 'confirm',
name: 'continue',
message: 'Do you want to run another script?',
default: true,
},
]);
continueRunning = answer.continue;
}
console.log('Goodbye!');
});
}

@@ -76,0 +92,0 @@ const program = new Command();

{
"name": "npm-script-selector",
"version": "1.0.3",
"version": "1.0.5",
"description": "A command line app for finding and running npm scripts within a project.",
"main": "index.js",
"type": "module",
"scripts": {
"build": "tsc",
"test": "jasmine",
"run": "node ./dist/app.js",
"start": "npm run build && npm run run"
"author": {
"name": "Justin L. Sunday",
"email": "admin@jlsunday.com",
"url": "https://jlsunday.com"
},
"bin": {
"npmss": "dist/app.js"
},
"homepage": "https://github.com/sundayj/npm-script-selector",
"repository": "github:sundayj/npm-script-selector",
"bugs": "https://github.com/sundayj/npm-script-selector/issues",
"license": "MIT",
"keywords": [

@@ -26,4 +24,13 @@ "typescript",

],
"author": "Justin L. Sunday",
"license": "ISC",
"main": "index.js",
"type": "module",
"scripts": {
"build": "tsc",
"test": "jasmine",
"start": "node ./dist/app.js",
"devstart": "npm run build && node ./dist/app.js -f package.json"
},
"bin": {
"npmss": "dist/app.js"
},
"dependencies": {

@@ -30,0 +37,0 @@ "commander": "^11.1.0",

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

ProgramName: 'NPM Script Selector',
Version: '1.0.3',
Version: '1.0.5',
Description: 'A CLI for finding npm scripts within a package and allowing a user to run them from the command line.',

@@ -29,4 +29,2 @@ Options: {

console.log(figlet.textSync(DEFAULTS.ProgramName, { font: 'Pagga' }));
export async function selectAndRunScript(filePath: string): Promise<void> {

@@ -68,3 +66,5 @@ const packageData = JSON.parse(fs.readFileSync(filePath, 'utf8'));

export function runProgram(filePath: string): void {
export async function runProgram(filePath: string): Promise<void> {
console.log(figlet.textSync(DEFAULTS.ProgramName, { font: 'Pagga' }));
console.log(); // Put some spacing between the title and output

@@ -76,5 +76,24 @@ if (!fs.existsSync(filePath)) {

selectAndRunScript(filePath);
let continueRunning = true;
while (continueRunning) {
await selectAndRunScript(filePath);
const answer = await inquirer.prompt([
{
type: 'confirm',
name: 'continue',
message: 'Do you want to run another script?',
default: true,
},
]);
continueRunning = answer.continue;
}
console.log('Goodbye!');
}
const program = new Command();

@@ -81,0 +100,0 @@

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