A child process implementation that automatically utilizes wine when running Windows EXE applications in Linux and macOS.
This modules aims to be a simple bridge between the common child process functions and Wine as required.
Basic child process functions are provided that runs Wine automicatilly when running in Linux or macOS. Otherwise, these functions acts similarly to the child process counterpart.
Calls exec function from child_process module. Wine is automatically used when using Linux or macOS.
Returns the child_process.ChildProcess
if successful or null
if using Linux or macOS with no Wine installed
For more information, please refer to child_process.exec documentation.
Parameter | Type | Description |
---|---|---|
command | string | The command to run, with space-separated arguments |
options | child_process.ExecOptions | Additional options for the exec function |
callback | callback(err, stdout, stderr) | Called with the output when process terminates |
Calls execFile function from child_process module. Wine is automatically used when using Linux or macOS.
Returns the child_process.ChildProcess
if successful or null
if using Linux or macOS with no Wine installed
For more information, please refer to child_process.execFile documentation.
Parameter | Type | Description |
---|---|---|
file | string | The name or path of the executable file to run |
args | readonly string[] | List of string arguments |
options | child_process.ExecFileOptions | Additional options for the execFile function |
callback | callback(err, stdout, stderr) | Called with the output when process terminates |
Calls execSync function from child_process module. Wine is automatically used when using Linux or macOS.
Returns the output Buffer or string if successful or null
if using Linux or macOS with no Wine installed
For more information, please refer to child_process.execSync documentation.
Parameter | Type | Description |
---|---|---|
command | string | The command to run, with space-separated arguments |
options | child_process.ExecSyncOptions | Additional options for the exec function |
Calls execFileSync function from child_process module. Wine is automatically used when using Linux or macOS.
Returns the output Buffer or string if successful or null
if using Linux or macOS with no Wine installed
For more information, please refer to child_process.execFileSync documentation.
Parameter | Type | Description |
---|---|---|
file | string | The name or path of the executable file to run |
args | readonly string[] | List of string arguments |
options | child_process.ExecFileSyncOptions | Additional options for the execFile function |
Some utility functions are also provided for basic check such as checking if Wine is installed in the system.
Returns true
if the system is running Windows or if Wine is installed in Linux or macOS. Otherwise, returns false
.
This is useful when checking if the rest of the child process functions can be safely used without running the child process functions.
It is advisable to check whether the functions can used to create child processes.
if (checkWindowsOrWine()) {
// Perform child process functions
}
When using cwd
option, the path is automatically joined with the exe command/file. This is only performed when running Linux and macOS since the main command becomes wine