
Security News
Researcher Exposes Zero-Day Clickjacking Vulnerabilities in Major Password Managers
Hacker Demonstrates How Easy It Is To Steal Data From Popular Password Managers
node-commander
Advanced tools
Commandline packages simplifies the asynchronous binary execution from Node
Define a list of commands by executable name, parameters in a array like
var commandItemsArray = [ ['ls','-l','./'], ['ls','-a','./'] ];
that is ls -s ./
, ls -a ./
.
Create an new Commandline
instance
var cmd=require('commandline');
var cmd = new CommandLine({
debug : true,
error : true,
delay : false });
Run the commands by queueing execution in the Commandline
cmd.executeCommands(commandItemsArray
, function(results) {
console.log(results);
}
, function(error) {
console.log(error);
});
Commandline
uses Promise
and Promise.all
to queue binaries/script execution, and join each child process when it ends.
All binaries that write to or can be piped to stdout
can be queued.
Get now playing track info from Spotify
var cmd = new CommandLine({
debug : true,
error : true,
delay : true });
var commandItemsArray=[
['osascript', '-e', 'tell application "Spotify" to player position as string'],
['osascript', '-e', 'tell application "Spotify" to artist of current track as string'],
['osascript', '-e', 'tell application "Spotify" to name of current track as string']
];
cmd.executeCommands(commandItemsArray
, function(results) {
console.log(results);
}
, function(error) {
console.log(error);
});
will return
[ { data: '119,833000183105',
exitCode: 0,
cli: 'osascript -e tell application "Spotify" to player position as string' },
{ data: 'Enforcer',
exitCode: 0,
cli: 'osascript -e tell application "Spotify" to artist of current track as string' },
{ data: 'Midnight Vice',
exitCode: 0,
cli: 'osascript -e tell application "Spotify" to name of current track as string' } ]
FAQs
Command line tools for Node.js
The npm package node-commander receives a total of 0 weekly downloads. As such, node-commander popularity was classified as not popular.
We found that node-commander 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
Hacker Demonstrates How Easy It Is To Steal Data From Popular Password Managers
Security News
Oxlint’s new preview brings type-aware linting powered by typescript-go, combining advanced TypeScript rules with native-speed performance.
Security News
A new site reviews software projects to reveal if they’re truly FOSS, making complex licensing and distribution models easy to understand.