wc

wc-cmd

execute command line on node

Showing:

Popularity

Downloads/wk

3

GitHub Stars

1

Maintenance

Last Commit

6yrs ago

Contributors

0

Package

Dependencies

1

License

MIT

Type Definitions

Tree-Shakeable

No?

Categories

Readme

wc-cmd

execute cmd for windows on nodejs

Demo

Installation

npm install wc-cmd

Usage

It returns a promise, so you can use it like this to execute a cmd.

var cmd = require('wc-cmd')
cmd('mkdir hh').then(
        function(data) {
            console.log(process.cwd());
        }
    )
    .then(
        function() {
            return cmd('dir')
        }
    )
    .then(function(data) {
        console.log(data.join(''))
        console.log('all cmd over!')
    })

And you can execute cmd queue in a array.

cmd(['rd hh', 'dir'])
    .then(
        function(data) {
            console.log(data.join(''))
        }
    );
    

Using standard API

/**
 * @param {string,array,object} command is a cmd command on windows.
 * @param {function} callback  The function will be called when command is over.
 * @param {function,boolean} log=[function|true|false] 
 * @return {Promise}
 * @example
 * cmd('cd ../',null,console.log)
 */ 
cmd(command,callback,log)   

Rate & Review

Great Documentation0
Easy to Use0
Performant0
Highly Customizable0
Bleeding Edge0
Responsive Maintainers0
Poor Documentation0
Hard to Use0
Slow0
Buggy0
Abandoned0
Unwelcoming Community0
100
No reviews found
Be the first to rate

Alternatives

No alternatives found

Tutorials

No tutorials found
Add a tutorial