MCPcopy
hub / github.com/chjj/tty.js / exec

Function exec

lib/tty.js:564–571  ·  view source on GitHub ↗
(args)

Source from the content-addressed store, hash-verified

562 var execFile = require('child_process').execFile;
563
564 function exec(args) {
565 var file = args.shift();
566 return execFile(file, args, function(err, stdout, stderr) {
567 if (err) return func(err);
568 if (stderr && !stdout) return func(new Error(stderr));
569 return func(null, stdout);
570 });
571 }
572
573 // X11:
574 return exec(['xsel', '-o', '-p'], function(err, text) {

Callers 1

tty.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected