Wiki

Clone wiki

jsactions_k / _jsaCScript.runtime

Languages: Japanese

_jsaCScript.runtime

Provides functions related to the runtime environment.

Methods

callProcess()

var promise = _jsaCScript.runtime.callProcess(data);
promise.then(function (result) {
    // ...
}).catch(function (error) {
    // ...
});

It's nessesary to set up jsacprochost to use this method.

Parameters

  • data
    object. The object to store the following parameters:

    • file
      string. The path of the executable file.
    • params (Optional)
      Array of string. The list of arguments.
    • directory (Optional)
      string. The path of the working directory.
    • communicate (Optional)
      boolean. Whether to wait for the process to terminate. Defaults to false.
    • input (Optional)
      string. The string to send to STDIN.
    • inencoding (Optional)
      string. The character encoding of STDIN.
    • outencoding (Optional)
      string. The character encoding of STDOUT.
    • errencoding (Optional)
      string. The character encoding of STDERR.

Return value

Promise.

If resolved, the following arguments are passed to the callback:

  • result
    object. The object to store the following properties:

    • pid
      number. The PID.
    • returncode (Optional)
      number. The return code.
    • output (Optional)
      string. The string got from STDOUT.
    • error (Optional)
      string. The string got from STDERR.

If rejected, the following arguments are passed to the callback:

  • error
    Error.

Updated