Nodejs Run cmd command

Source: Internet
Author: User
Tags install node npm install node

Node-cmd

Installation:

NPM Install Node-cmd

NPM Install Node-cmd–save//installation to the project catalog

Two ways of running the command line:

Method arguments functionality
Run Command Runs a command asynchronously
Get Command,callback Runs a command asynchronously, when the command was complete all of the stdout would be passed to the callback

API usage:

var nodecmd = require (' node-cmd '), function runcmdtest () {    nodecmd.get (        ' ipconfig ',        function (err, data, stderr) {            console.log (data);        }    );     Nodecmd.run (' ipconfig ');}

  

Reference:

Riaevangelist/node-cmd

Node-cmd NPM

Use Nodejs to increase cmd command in Windows

Child_process

Reference:

Nodejs Call Scripts (Python/shell) and system commands

Nodejs how to invoke the cmd command

Nodejs Run cmd command

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.