@NodeModule(name="process") public class NodeModuleProcess extends BaseNodeModule
process module.| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
FUNCTION_CHDIR
The function name for
process.chdir(). |
static java.lang.String |
FUNCTION_CWD
The function name for
process.cwd(). |
static java.lang.String |
FUNCTION_ON
The function name for
process.on(). |
static java.lang.String |
PROPERTY_VERSION
The property name for
process.version. |
moduleObject, name| Constructor and Description |
|---|
NodeModuleProcess(V8ValueObject moduleObject,
java.lang.String name)
Instantiates a new Node module process.
|
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
getVersion()
Gets the Node.js version string (e.g.
|
java.io.File |
getWorkingDirectory()
Gets the current working directory of the Node.js process.
|
void |
on(java.lang.String eventName,
V8ValueFunction v8ValueFunction)
Registers an event listener on the process object.
|
void |
setWorkingDirectory(java.io.File workingDirectory)
Sets the current working directory of the Node.js process.
|
void |
setWorkingDirectory(java.lang.String workingDirectory)
Sets the current working directory of the Node.js process.
|
close, getModuleObject, getName, isClosedpublic static final java.lang.String FUNCTION_CHDIR
process.chdir().public static final java.lang.String FUNCTION_CWD
process.cwd().public static final java.lang.String FUNCTION_ON
process.on().public static final java.lang.String PROPERTY_VERSION
process.version.public NodeModuleProcess(V8ValueObject moduleObject, java.lang.String name)
moduleObject - the underlying V8 object representing the modulename - the module namepublic java.lang.String getVersion()
throws JavetException
JavetException - the javet exceptionpublic java.io.File getWorkingDirectory()
throws JavetException
FileJavetException - the javet exceptionpublic void on(java.lang.String eventName,
V8ValueFunction v8ValueFunction)
throws JavetException
eventName - the event name (e.g. "exit", "uncaughtException")v8ValueFunction - the callback functionJavetException - the javet exceptionpublic void setWorkingDirectory(java.io.File workingDirectory)
throws JavetException
workingDirectory - the working directory as a FileJavetException - the javet exceptionpublic void setWorkingDirectory(java.lang.String workingDirectory)
throws JavetException
workingDirectory - the working directory pathJavetException - the javet exception