Skip to content

fahad-israr/command_line_with_electron

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 

Repository files navigation

executing command line codes with electron JS

We are using node child_process

Insert the following in main.js file:

    const exec = require('child_process').exec;

  function execute(command, callback) {
      exec(command, (error, stdout, stderr) => { 
          callback(stdout); 
      });
  };

  // call the function
  execute('ping -c 4 0.0.0.0', (output) => {
      console.log(output);
  });

The file main.js demonstrates an example.


About

Execute codes on Command Line in Electron Js

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published