executeNodeSetParser.mjs 526 B

123456789101112131415161718192021
  1. /*
  2. sources:
  3. https://stackoverflow.com/questions/1880198/how-to-execute-shell-command-in-javascript, 02/03/2022
  4. */
  5. export function parseAll(){
  6. var exec = require('child_process').exec;
  7. var listxml = '';
  8. exec('cd .. && cd nodesets && ls',
  9. function (error, stdout, stderr) {
  10. //console.log('stdout: ' + stdout);
  11. //console.log('stderr: ' + stderr);
  12. listxml = stdout;
  13. console.log('stdout: ' + listxml);
  14. if (error !== null) {
  15. console.log('exec error: ' + error);
  16. }
  17. });
  18. }