New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

eshost-cli

Package Overview
Dependencies
Maintainers
3
Versions
42
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

eshost-cli - npm Package Compare versions

Comparing version 7.5.2 to 7.6.0

33

bin/eshost.js

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

const esh = require('eshost');
const styles = require('ansi-styles');
const Table = require('cli-table');

@@ -51,2 +52,5 @@ const uniqueTempDir = require('unique-temp-dir');

.alias('coalesce', 's')
.describe('color', 'specify the color to use in output, eg. --color.error red --color.header blue')
.describe('no-color', 'do not colorize output')
.boolean('no-color')
.describe('showSource', 'show input source')

@@ -215,2 +219,3 @@ .boolean('showSource')

coalesce: argv.coalesce,
color: { error: 'magentaBright', header: 'grey', ...(argv.color || {}) },
showSource: argv.showSource,

@@ -220,2 +225,14 @@ unanimous: argv.unanimous

if (argv.noColors) {
reporterOptions.color = false;
}
let invalidColor = Object.values(reporterOptions.color).find(color => !styles[color]);
if (invalidColor) {
console.log(`Invalid color or style: "${invalidColor}"\n`);
console.log(`Choose from:\n${Object.keys(styles).map(style => `- ${style}\n`).join('')}`);
process.exit(1);
}
let reporter;

@@ -229,4 +246,7 @@ if (argv.table) {

if (argv.list || argv.add || argv.edit || argv.delete ||
argv['delete-all'] || argv['configure-esvu'] || argv['configure-jsvu']) {
console.log(chalk.grey(`Using config "${config.configPath}"`));
argv['delete-all'] || argv.configureEsvu || argv.configureJsvu) {
const message = `Using config "${config.configPath}"`;
console.log(
argv.noColors ? message : chalk.grey(message)
);
}

@@ -273,4 +293,4 @@ // list available hosts

if (argv['configure-esvu'] || argv['configure-jsvu']) {
const vu = argv['configure-esvu']
if (argv.configureEsvu || argv.configureJsvu) {
const vu = argv.configureEsvu
? 'esvu'

@@ -381,3 +401,6 @@ : 'jsvu';

}).catch(e => {
console.error(chalk.red(`Failure attempting to eval script in agent: ${e.stack}`));
const message = `Failure attempting to eval script in agent: ${e.stack}`;
console.error(
argv.noColors ? message : chalk.red(message)
);
});

@@ -384,0 +407,0 @@ }

21

lib/Reporter.js

@@ -16,3 +16,3 @@ 'use strict';

if (this.options.showSource) {
Reporter.printSource(source);
this.printSource(source);
}

@@ -24,3 +24,5 @@ }

if (error) {
resultCell += `\n${chalk.red(`${error.name}: ${error.message}`)}`;
resultCell += this.options.color
? `\n${chalk[this.options.color.error](`${error.name}: ${error.message}`)}`
: `\n${error.name}: ${error.message}`;
}

@@ -52,2 +54,12 @@ resultCell = resultCell.replace(/\r/g, '');

printSource(source) {
const header = '## Source';
console.log(
this.options.color
? chalk[this.options.color.header](header)
: header
);
console.log(`${source}\n`);
}
static coalesce(records) {

@@ -63,7 +75,2 @@ const resultsMap = new Map();

}
static printSource(source) {
console.log(chalk.blue('## Source'));
console.log(`${source}\n`);
}
}

@@ -14,3 +14,3 @@ const Reporter = require('../Reporter.js');

const joinedHosts = hosts.join(", ").trim();
printHostResult(joinedHosts, resultString);
this.printHostResult(joinedHosts, resultString);
}

@@ -23,3 +23,3 @@

this.results.forEach(row => {
printHostResult(row[0], row[1]);
this.printHostResult(row[0], row[1]);
});

@@ -29,7 +29,11 @@ }

}
printHostResult(name, result) {
const header = `#### ${name}`;
console.log(
this.options.color
? chalk[this.options.color.header](header)
: header
);
console.log(`${result}\n`);
}
}
function printHostResult(name, result) {
console.log(chalk.blue(`#### ${name}`));
console.log(`${result}\n`);
}
{
"name": "eshost-cli",
"version": "7.5.2",
"version": "7.6.0",
"description": "Run scripts in any ECMAScript host",

@@ -9,3 +9,4 @@ "bin": {

"dependencies": {
"chalk": "^1.1.1",
"ansi-styles": "^4.2.1",
"chalk": "^4.1.0",
"cli-table": "^0.3.1",

@@ -12,0 +13,0 @@ "configstore": "^1.4.0",

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