Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to get cli output on web page by command? #107

Open
qadeesz opened this issue Jun 24, 2020 · 1 comment
Open

How to get cli output on web page by command? #107

qadeesz opened this issue Jun 24, 2020 · 1 comment

Comments

@qadeesz
Copy link

qadeesz commented Jun 24, 2020

No description provided.

@LinkSake
Copy link

If your web is using NodeJS as the backend you can use the child_process module that comes with Node.

E.g.

var exec = require('child_process').exec, child;

child = exec('corona usa',
    function (error, stdout, stderr) {
        console.log('stdout: ' + stdout);
        console.log('stderr: ' + stderr);
        if (error !== null) {
             console.log('exec error: ' + error);
        }
    });
 child();

I found about it on this Stack Overflow thread

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants