Answers for "javascript run command"

0

javascript run command

const { execSync } = require('child_process');

const output = execSync('ls', { encoding: 'utf-8' });

console.log('The output is:');
console.log(output);
Posted by: Guest on August-19-2020
0

run command line using javascript

const { exec } = require("child_process");

exec("ls -la", (error, stdout, stderr) => {
    if (error) {
        console.log(`error: ${error.message}`);
        return;
    }
    if (stderr) {
        console.log(`stderr: ${stderr}`);
        return;
    }
    console.log(`stdout: ${stdout}`);
});
Posted by: Guest on January-20-2021
0

how to send a command in js

<form action="">
  <select name="channel">
   <option value="#channel1">channel1</option>
   <option value="#channel2">channel2</option>
  </select>
 </form>
Posted by: Guest on May-23-2020

Code answers related to "Javascript"

Browse Popular Code Answers by Language