About JanOS

Process API

The process execution API allows you to run arbitrary executables from JavaScript. Read our docs on cross compiling executables for JanOS. It's function are exposed under navigator.mozOs.

Running an executable

At the moment this API does not allow streaming, or writing to stdin. We welcome pull requests.


Promise exec(DOMString path, optional sequence args);

interface MozOsExecResponse {
  readonly attribute long exitCode;
  readonly attribute DOMString stdout;
  readonly attribute DOMString stderr;
};

Example:


navigator.mozOs.exec('ls', [ '-al', '/data/local' ])
  .then(res => console.log('exec', res.exitCode, res.stdout, res.stderr))
  .catch(err => console.error('exec failed', err));