Gathering detailed insights and metrics for msnode-cmd
Gathering detailed insights and metrics for msnode-cmd
Gathering detailed insights and metrics for msnode-cmd
Gathering detailed insights and metrics for msnode-cmd
Simple commandline interface to allow you to run cli or bash style commands as if you were in the terminal.
npm install msnode-cmd
Typescript
Module System
Node Version
NPM Version
JavaScript (100%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
MIT License
285 Stars
50 Commits
31 Forks
6 Watchers
2 Branches
6 Contributors
Updated on Jan 13, 2025
Latest Version
3.0.0
Package Id
msnode-cmd@3.0.0
Unpacked Size
8.46 kB
Size
3.15 kB
File Count
9
NPM Version
8.1.0
Node Version
14.17.3
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
No dependencies detected.
Node.js commandline/terminal interface.
Simple commandline or terminal interface to allow you to run cli or bash style commands as if you were in the terminal.
Run commands asynchronously, and if needed can get the output as a string.
npm info :
See npm trends and stats for node-cmd
GitHub info :
Package details websites :
This work is licenced via the DBAD Public Licence.
method | arguments | functionality |
---|---|---|
run | command | runs a command asynchronously |
get | command,callback | runs a command asynchronously, when the command is complete all of the stdout will be passed to the callback |
1 2 var cmd=require('node-cmd'); 3 4 cmd.get( 5 'pwd', 6 function(err, data, stderr){ 7 console.log('the current working dir is : ',data) 8 } 9 ); 10 11 cmd.run('touch example.created.file'); 12 13 cmd.get( 14 'ls', 15 function(err, data, stderr){ 16 console.log('the current dir contains these files :\n\n',data) 17 } 18 ); 19 20 cmd.get( 21 ` 22 git clone https://github.com/RIAEvangelist/node-cmd.git 23 cd node-cmd 24 ls 25 `, 26 function(err, data, stderr){ 27 if (!err) { 28 console.log('the node-cmd cloned dir contains these files :\n\n',data) 29 } else { 30 console.log('error', err) 31 } 32 33 } 34 ); 35
this example by @stephen-last
1 2import Promise from 'bluebird' 3import cmd from 'node-cmd' 4 5const getAsync = Promise.promisify(cmd.get, { multiArgs: true, context: cmd }) 6 7getAsync('node -v').then(data => { 8 console.log('cmd data', data) 9}).catch(err => { 10 console.log('cmd err', err) 11}) 12
If you need PIDs, stdio,stdin, stdout, stderr, etc. access, for use in your code, or cleaning up, @freemany added in some functionality to get a reference to the child process as the returned value of the get
and run
calls.
1 2 var cmd=require('../cmd.js'); 3 4 var process=cmd.get('node'); 5 console.log(process.pid); 6
1const cmd=require('../cmd.js'); 2 3const processRef=cmd.get('python -i'); 4let data_line = ''; 5 6//listen to the python terminal output 7processRef.stdout.on( 8 'data', 9 function(data) { 10 data_line += data; 11 if (data_line[data_line.length-1] == '\n') { 12 console.log(data_line); 13 } 14 } 15); 16 17const pythonTerminalInput=`primes = [2, 3, 5, 7] 18for prime in primes: 19 print(prime) 20 21`; 22 23//show what we are doing 24console.log(`>>>${pythonTerminalInput}`); 25 26//send it to the open python terminal 27processRef.stdin.write(pythonTerminalInput); 28
Output :
1 2>>>primes = [2, 3, 5, 7] 3for prime in primes: 4 print(prime) 5 6 72 83 95 107 11 12
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
0 existing vulnerabilities detected
Reason
license file detected
Details
Reason
Found 6/21 approved changesets -- score normalized to 2
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2025-07-07
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More