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

meta-exec

Package Overview
Dependencies
Maintainers
1
Versions
20
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

meta-exec - npm Package Compare versions

Comparing version 1.1.1 to 1.2.0

__tests__/index.js

30

index.js

@@ -6,4 +6,3 @@ const chalk = require('chalk');

module.exports = function (options, cb, errorCb) {
module.exports = function(options, cb, errorCb) {
if (options.stdio === undefined) options.stdio = [0, 1, 2];

@@ -22,4 +21,3 @@ if (options.suppressLogging === undefined) options.suppressLogging = false;

try {
if (!options.suppressLogging)
console.log(`\n${chalk.cyan(path.basename(options.displayDir))}:`);
if (!options.suppressLogging) console.log(`\n${chalk.cyan(path.basename(options.displayDir))}:`);

@@ -32,35 +30,33 @@ code = execSync(options.cmd, {

} catch (err) {
if (errorCb) errorCb(err);
if (errorCb) errorCb(err);
// if there is no error callback, we're just going to forward the output
let errorMessage = `${chalk.red(path.basename(options.displayDir))}: command '${options.cmd}' exited with error: ${err.toString()}`;
if ( ! options.suppressLogging) console.error(errorMessage);
let errorMessage = `${chalk.red(path.basename(options.displayDir))}: command '${
options.cmd
}' exited with error: ${err.toString()}`;
if (!options.suppressLogging) console.error(errorMessage);
if (cb) return cb(null, { error: errorMessage });
return;
}
if (code) {
let errorMessage = `${chalk.red(path.basename(options.displayDir))} '${options.cmd}' exited with code: ${code}`;
if (errorCb) errorCb(new Error(errorMessage));
if ( ! options.suppressLogging) console.error(errorMessage);
if (!options.suppressLogging) console.error(errorMessage);
if (cb) return cb(null, { err: errorMessage });
return;
}
}
let success = chalk.green(`${path.basename(options.displayDir)} ✓`);
if ( ! options.suppressLogging) console.log(success);
if (!options.suppressLogging) console.log(success);
if (cb) return cb(null, { output: success });
};
{
"name": "meta-exec",
"version": "1.1.1",
"version": "1.2.0",
"description": "exec plugin for meta for executing synchronous commands to stdout with a standard format",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\""
"commit": "git-cz",
"lint": "prettier --write \"bin/*\" index.js",
"test": "jest --config jest.json --coverage",
"test:coverage": "jest --config jest.json --coverage",
"test:watch": "jest --config jest.json --watch"
},
"husky": {
"hooks": {
"commit-msg": "commitlint -E HUSKY_GIT_PARAMS",
"pre-commit": "pretty-quick --staged"
}
},
"repository": {

@@ -26,3 +36,13 @@ "type": "git",

"debug": "^4.0.0"
},
"devDependencies": {
"@commitlint/cli": "8.0.0",
"@commitlint/config-conventional": "8.0.0",
"commitizen": "3.1.1",
"cz-conventional-changelog": "2.1.0",
"husky": "2.4.1",
"jest": "24.8.0",
"prettier": "1.18.2",
"pretty-quick": "1.11.0"
}
}

@@ -0,2 +1,4 @@

[![Build Status](https://travis-ci.com/mateodelnorte/meta-exec.svg?branch=master)](https://travis-ci.com/mateodelnorte/meta-exec)
# Introduction

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