Skip to main content

global (value)

For compatibility with Node.js scripts, the global object is accessible via the global variable named "global".

var global: typeof globalThis;

process (object)

A process global is provided for rudimentary compatibility with Node.js scripts. It contains a subset of the properties found on the Node.js process global, which each forward to their corresponding yavascript API.

For instance, process.env is a getter that returns env, and process.argv is a getter that returns scriptArgs.

If you are writing yavascript-specific code, you should use yavascript's APIs instead of process.

var process: {
version: string;
node: string;
yavascript: string;
unicode: string;
};
arch: string;
readonly env: {
[key: string]: string | undefined;
};
readonly argv: Array<string>;
readonly argv0: string;
readonly execPath: string;
exitCode: number;
exit(code?: number | null | undefined): void;
};

process.version (string property)

version: string;

process.versions (object property)

node: string;
yavascript: string;
unicode: string;
}

process.versions.node (string property)

node: string;

process.versions.yavascript (string property)

yavascript: string;

process.versions.unicode (string property)

unicode: string;

process.arch (string property)

arch: string;

process.env (readonly object property)

Same as the global env.

readonly env: {
[key: string]: string | undefined;
};

process.argv (readonly property)

Same as the global scriptArgs.

readonly argv: Array<string>;

process.argv0 (readonly string property)

Same as scriptArgs[0].

readonly argv0: string;

process.execPath (readonly string property)

Shortcut for os.realpath(os.execPath()), using the QuickJS os module.

readonly execPath: string;

process.exitCode (number property)

Uses std.getExitCode() and std.setExitCode() from the QuickJS std module.

exitCode: number;

process.exit (method)

Uses std.exit() from the QuickJS std module.

exit(code?: number | null | undefined): void;