RingoJS

Module system

This module provides an implementation of the system module compliant to the CommonJS System/1.0 specification. Beyond the standard a print() function is provided.

Functions

Properties


args

An array of strings representing the command line arguments passed to the running script.

Example

>> ringo .\myScript.js foo bar baz 12345
system.args -> ['.\myScript.js', 'foo', 'bar', 'baz', '12345']

env

An object containing of the current system environment.

Example

{
  USERPROFILE: 'C:\Users\username',
  JAVA_HOME: 'C:\Program Files\Java\jdk\',
  SystemDrive: 'C:',
  Path: '%System%/...',
  PROCESSOR_REVISION: '1a05',
  USERDOMAIN: 'EXAMPLE',
  SESSIONNAME: 'Console',
  TMP: 'C:\Temp',
  PROMPT: '$P$G',
  PROCESSOR_LEVEL: '6',
  LOCALAPPDATA: 'C:\Local',
  ...
}

exit (status)

Terminates the current process.

Parameters

Number status

The exit status, defaults to 0.


print ()

A utility function to write to stdout.


stderr

A TextStream to write to stderr.


stdin

A TextStream to read from stdin.


stdout

A TextStream to write to stdout.