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.
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.
Example
{
gopherProxySet: 'false',
awt.toolkit: 'sun.lwawt.macosx.LWCToolkit',
java.specification.version: '11',
sun.cpu.isalist: '',
sun.jnu.encoding: 'UTF-8',
java.class.path: '/Users/nobody/ringojs/run.jar',
java.vm.vendor: 'Eclipse Adoptium',
sun.arch.data.model: '64',
java.vendor.url: 'https://adoptium.net/',
user.timezone: 'Europe/Vienna',
...
}
stderr
A TextStream to write to stderr.
stdin
A TextStream to read from stdin.
stdout
A TextStream to write to stdout.