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

checkcommand

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

checkcommand - npm Package Compare versions

Comparing version 1.0.0 to 1.1.0

CHANGELOG.md

30

build/checkcommand.js

@@ -1,3 +0,7 @@

var utils;
var Promise, utils, _;
_ = require('lodash');
Promise = require('bluebird');
utils = require('./utils');

@@ -29,1 +33,25 @@

};
/**
* @summary Ensure multiple commands at the same time.
* @function
* @public
*
* @param {Object} commands - commands
* @returns {Promise}
*
* @example
* checkcommand.ensureMultiple
* 'wget': 'Missing wget'
* 'curl': 'Missing curl'
* 'axel': 'Missing axel'
*/
exports.ensureMultiple = function(commands, callback) {
var ensurePromises;
ensurePromises = _.map(_.pairs(commands), function(command) {
return exports.ensure(_.first(command), _.last(command));
});
return Promise.all(ensurePromises).nodeify(callback);
};

5

package.json
{
"name": "checkcommand",
"version": "1.0.0",
"version": "1.1.0",
"description": "Check that a command exists",

@@ -41,4 +41,5 @@ "main": "build/checkcommand.js",

"bluebird": "^2.9.30",
"command-exists": "^0.1.0"
"command-exists": "^0.1.0",
"lodash": "^3.9.3"
}
}

@@ -64,2 +64,37 @@ checkcommand

### checkcommand.ensureMultiple(Object commands[, Function callback])
Ensure multiple commands. A utility function to prevent calling `checkcommand.ensure()` multiple times.
The `commands` object contains command names as property keys, and error messages as values.
Example:
```coffee
checkcommand = require('checkcommand')
checkcommand.ensureMultiple
'wget': 'Missing wget'
'curl': 'Missing curl'
.then ->
console.log('It seems that wget and curl are installed!')
.catch (error) ->
console.error(error)
```
***
```coffee
checkcommand = require('checkcommand')
checkcommand.ensureMultiple
'wget': 'Missing wget'
'curl': 'Missing curl'
, (error) ->
if error?
console.error(error.message)
else
console.log('It seems that wget and curl are installed!')
```
Tests

@@ -66,0 +101,0 @@ -----

Sorry, the diff of this file is not supported yet

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