
Security News
Axios Supply Chain Attack Reaches OpenAI macOS Signing Pipeline, Forces Certificate Rotation
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.
Ketch helps you execute, one way or another.
Use this module to easily build commands for passing to child_process functions.
When called as a function, this module will return a new Ketch instance.
npm install ketch
Example:
var ketch = require('ketch');
// what branch am I on?
ketch('git')
.prepend('/usr/bin/env')
.push('symbolic-ref')
.opt('quiet', 'short')
.push('HEAD')
.exec()
// returns stdout, stderr as array
.done(function(output) {
console.log(output[0].trim());
}, function(err) {
throw err;
});
// use a callback instead
ketch('git')
.prepend('/usr/bin/env')
.push('symbolic-ref')
.opt('quiet', 'short')
.push('HEAD')
.exec(function(err, stdout, stderr) {
if (err) {
throw err;
}
console.log(stdout.trim());
});
Provides chainable functions to easily build and execute a command.
last_err: String , Last error, if present
last_stdout: String , Last stdout value, if present
last_stderr: String , Last stderr value, if present
last_exec_cmd: String , Last command run with child_process.exec()
last_execFile_cmd: String , Last command run with child_process.execFile()
last_fork_cmd: String , Last command run with child_process.fork()
last_spawn_cmd: String , Last command run with child_process.spawn()
cmd: Array , Internal array representation of this command.
Parse function arguments into an array. arguments may be one of:
Returns: Array, Command as an array
Append an argument or arguments to this command. Alias: push()
Returns: Ketch, Ketch instance
Prepend an argument or arguments to this command. Alias: unshift()
Returns: Ketch, Ketch instance
Sugar function to append one or more options to the command.
Returns: Ketch, Ketch instance
Example:
ketch('git').opt('q', 'short') // becomes "git -q --short"
Returns current command as a space-separated string.
Returns: String, String representation of this command
Pops the last argument off of the command. Does not return it. If you need that, use ketch('foo').cmd.pop()
Returns: Ketch, Ketch instance
Shifts the first argument off of the command. Does not return it. If you need that, use ketch('foo').cmd.shift()
Returns: Ketch, Ketch instance
Splice the command.
Returns: Ketch, Ketch instance
"Serialize" this command into command/arguments array format, suitable for passing to execFile or fork. Aliases: get(), toJSON
Returns: Array, Array where first item is a string, second is array of commands
Wrapper around child_process.exec(). Returns a promise, or
Parameters
options: Object, Options for child_process.exec()
callback: function, If present, will execute as NodeJS-style callback; otherwise will return a Promise.
Returns: ChildProcess | Promise, ChildProcess instance if callback is specified, otherwise a Promise.
Wrapper around child_process.execFile(). Returns a promise, or
Parameters
options: Object, Options for child_process.execFile()
callback: function, If present, will execute as NodeJS-style callback; otherwise will return a Promise.
Returns: ChildProcess | Promise, ChildProcess instance if callback is specified, otherwise a Promise.
Wrapper around child_process.fork(). Returns a promise, or
Parameters
options: Object, Options for child_process.fork()
callback: function, If present, will execute as NodeJS-style callback; otherwise will return a Promise.
Returns: ChildProcess | Promise, ChildProcess instance if callback is specified, otherwise a Promise.
Wrapper around child_process.spawn(). Returns a promise, or
Parameters
options: Object, Options for child_process.spawn()
callback: function, If present, will execute as NodeJS-style callback; otherwise will return a Promise.
Returns: ChildProcess | Promise, ChildProcess instance if callback is specified, otherwise a Promise.
Obliterates the current command. Alias: reset()
Returns: Ketch, Ketch instance
Debugging function to log the current command to console. Chainable, for your pleasure.
Returns: Ketch, Ketch instance
"Tap" into the chain.
Parameters
callback: function, Which will be passed the Ketch instance.
Returns: Ketch, Ketch instance
© 2014-2015, Christopher Hiller. Licensed MIT.
FAQs
Ketch helps you execute, one way or another.
The npm package ketch receives a total of 2 weekly downloads. As such, ketch popularity was classified as not popular.
We found that ketch demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.

Security News
Open source is under attack because of how much value it creates. It has been the foundation of every major software innovation for the last three decades. This is not the time to walk away from it.

Security News
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.