Process

  • The process object provide the information about the process.

Object: process

process.arch

  • <string>ex) 'arm', 'x64', ...

The system architecture which the Kaluma firmware is compiled.

process.platform

  • <string>ex) 'linux', 'darwin', 'unknown', ...

The OS system which the Kaluma firmware is running.

process.version

  • <string>version number, semver format. ex) '0.1.0', ...

process.builtin_modules

  • <string[]>array of built-in module names.

There's no need to use require before using the built-in module.

process.getBuiltinModule(builtin_module_name)

  • builtin_module_name <string>
  • Returns: <function>

load the builtin module and return the module as a function

process.binding(native_module_name)

  • native_module_name <string>
  • Returns: <function>

load a native module

Has properties : binding has native module names as properties

process.memoryUsage()

  • Returns: <object>
    • heapTotal <number>
    • heapUsed <number>
    • heapPeak <number>

Returns an object describing memory usage.

process.stdin

Returns a stream object connected to standard input.

// reads 100 bytes from standard in
let size = 0;
while (size < 100) {
  let chunk = process.stdin.read();
  if (chunk) {
    let s = String.fromCharCode.apply(null, chunk);
    console.log('data = ', s);
    size += chunk.length;
  }
}

process.stdout

Returns a stream object connected to standard output.

let data = new Uint8Array([65, 66, 67, 68, 69]); // "ABCDE"
process.stdout.write(data);