Module system

System module compliant with the CommonJS System/1.0 specification. Additional non-standard methods for sleeping on the current thread, spawning a new thread and spawning processes are provided.

Functions

Properties


args

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


env

An object containing our environment variables.


exit (status)

Terminates the current process.

Parameters

number status The exit status, defaults to 0.

print ()

A utility function to write to stdout.


sleep (milliseconds)

Suspends the current process for the specified number of milliseconds.

Parameters

Number milliseconds The number of milliseconds to sleep.

spawn (run)

Spawns a new thread.

Parameters

Function run entry point of the new thread.

stderr

A TextStream to write to stderr.


stdin

A TextStream to read from stdin.


stdout

A TextStream to write to stdout.