Process
Instance Members
stdout: js.node.stream.IWritableA Writable Stream to stdout.
stderr and stdout are unlike other streams in Node in that writes to them are usually blocking.
stderr: js.node.stream.IWritableA writable stream to stderr.
stderr and stdout are unlike other streams in Node in that writes to them are usually blocking.
stdin: js.node.stream.IReadableA Readable Stream for stdin.
An array containing the command line arguments.
The first element will be node, the second element will be the name of the JavaScript file.
The next elements will be any additional command line arguments.
E.g: $ node process-2.js one two=three four 0: node 1: /Users/mjr/work/node/process-2.js 2: one 3: two=three 4: four
execPath: StringThis is the absolute pathname of the executable that started the process.
This is the set of node-specific command line options from the executable that started the process.
These options do not show up in argv, and do not include the node executable, the name of the script,
or any options following the script name.
These options are useful in order to spawn child processes with the same execution environment as the parent.
env: haxe.DynamicAccess<String>An object containing the user environment. See environ(7).
A number which will be the process exit code, when the process either exits gracefully,
or is exited via process.exit() without specifying a code.
Specifying a code to process.exit(code) will override any previous setting of process.exitCode.
version: StringA compiled-in property that exposes NODE_VERSION.
versions: haxe.DynamicAccess<String>A property exposing version strings of node and its dependencies.
config: DynamicAn Object containing the JavaScript representation of the configure options that were used to compile the current node executable. This is the same as the "config.gypi" file that was produced when running the ./configure script.
pid: IntThe PID of the process.
title: StringGetter/setter to set what is displayed in 'ps'.
When used as a setter, the maximum length is platform-specific and probably short. On Linux and OS X, it's limited to the size of the binary name plus the length of the command line arguments because it overwrites the argv memory.
arch: StringWhat processor architecture you're running on: 'arm', 'ia32', or 'x64'.
platform: StringWhat platform you're running on: 'darwin', 'freebsd', 'linux', 'sunos' or 'win32'
ppid: IntThe PID of the parent process
release: ReleaseThe metadata of the current release
report: ReportUsed for diagnostic reports
mainModule: ModuleAlternate way to retrieve require.main. The difference is that if the main module changes at runtime, require.main might still refer to the original main module in modules that were required before the change occurred. Generally it's safe to assume that the two refer to the same module.
As with require.main, it will be undefined if there was no entry script.
noDeprecation: BoolDisable run-time deprecation warnings.
See Util.deprecate.
traceDeprecation: BoolEnable logging of deprecation warnings.
See Util.deprecate.
throwDeprecation: BoolThrow on deprecated API usage.
See Util.deprecate.
abort(): VoidThis causes node to emit an abort. This will cause node to exit and generate a core file.
Changes the current working directory of the process or throws an exception if that fails.
| Name | Type |
|---|---|
directory |
String |
cwd(): StringReturns the current working directory of the process.
| Returns |
|---|
| String |
Ends the process with the specified code. If the code is omitted, exit uses either the
'success' code 0 or the value of process.exitCode if specified.
| Name | Type | Default |
|---|---|---|
code |
Int | (optional) |
getgid(): IntGets the group identity of the process. See getgid(2). Note: this function is only available on POSIX platforms (i.e. not Windows)
| Returns |
|---|
| Int |
Sets the group identity of the process. See setgid(2). This accepts either a numerical ID or a groupname string. If a groupname is specified, this method blocks while resolving it to a numerical ID.
Note: this function is only available on POSIX platforms (i.e. not Windows)
| Name | Type |
|---|---|
id |
Int |
getuid(): IntGets the user identity of the process. See getuid(2). Note: this function is only available on POSIX platforms (i.e. not Windows)
| Returns |
|---|
| Int |
Sets the user identity of the process. See setuid(2). This accepts either a numerical ID or a username string. If a username is specified, this method blocks while resolving it to a numerical ID.
Note: this function is only available on POSIX platforms (i.e. not Windows)
| Name | Type |
|---|---|
id |
Int |
Returns an array with the supplementary group IDs. POSIX leaves it unspecified if the effective group ID is included but node.js ensures it always is. Note: this function is only available on POSIX platforms (i.e. not Windows)
| Returns |
|---|
| Array<Int> |
setgroups(groups: Array<haxe.extern.EitherType<String, Int>>): VoidSets the supplementary group IDs. This is a privileged operation, meaning you need to be root or have the CAP_SETGID capability.
Note: this function is only available on POSIX platforms (i.e. not Windows) The list can contain group IDs, group names or both.
| Name | Type |
|---|---|
groups |
Array<haxe.extern.EitherType<String, Int>> |
initgroups(user: haxe.extern.EitherType<String, Int>, extra_group: haxe.extern.EitherType<String, Int>): VoidReads /etc/group and initializes the group access list, using all groups of which the user is a member. This is a privileged operation, meaning you need to be root or have the CAP_SETGID capability.
Note: this function is only available on POSIX platforms (i.e. not Windows)
| Name | Type |
|---|---|
user |
haxe.extern.EitherType<String, Int> |
extra_group |
haxe.extern.EitherType<String, Int> |
Send a signal to a process.
pid is the process id and signal is the string describing the signal to send. Signal names are strings like 'SIGINT' or 'SIGHUP'.
If omitted, the signal will be 'SIGTERM'. See Signal Events and kill(2) for more information.
Will throw an error if target does not exist, and as a special case, a signal of 0 can be used to test for the existence of a process.
Note that just because the name of this function is kill, it is really just a signal sender, like the kill system call.
The signal sent may do something other than kill the target process.
| Name | Type | Default |
|---|---|---|
pid |
Int | |
signal |
String | (optional) |
memoryUsage(): MemoryUsageReturns an object describing the memory usage of the Node process measured in bytes.
| Returns |
|---|
| MemoryUsage |
nextTick(callback: Function, args: haxe.extern.Rest): VoidOn the next loop around the event loop call this callback. This is not a simple alias to setTimeout(fn, 0), it's much more efficient. It typically runs before any other I/O events fire, but there are some exceptions.
This is important in developing APIs where you want to give the user the chance to assign event handlers after an object has been constructed, but before any I/O has occurred.
| Name | Type |
|---|---|
callback |
Function |
args |
haxe.extern.Rest |
Sets or reads the process's file mode creation mask. Child processes inherit the mask from the parent process. Returns the old mask if mask argument is given, otherwise returns the current mask.
| Name | Type | Default |
|---|---|---|
mask |
Int | (optional) |
| Returns |
|---|
| Int |
uptime(): FloatNumber of seconds Node has been running.
| Returns |
|---|
| Float |
Returns the current high-resolution real time in a [seconds, nanoseconds] tuple Array.
It is relative to an arbitrary time in the past.
It is not related to the time of day and therefore not subject to clock drift.
The primary use is for measuring performance between intervals.
You may pass in the result of a previous call to hrtime to get a diff reading,
useful for benchmarks and measuring intervals
| Returns |
|---|
| Array<Float> |
Send a message to the parent process.
Only available for child processes. See ChildProcess.send.
| Name | Type | Default |
|---|---|---|
message |
Dynamic | |
callback |
Function | (optional) |
| Returns |
|---|
| Bool |
disconnect(): VoidClose the IPC channel to parent process.
Only available for child processes. See ChildProcess.disconnect.