ipc-proxy0-pmb
Convenience wrapper for child_process.fork
API
This module exports an object with these methods:
.spawn(libs[, spawnOpts][, then])
Spawns an IPC proxy instance for the module name(s) from libs
,
which should be a string or an array of strings.
Returns the subprocess object, or false
if it couldn't fork()
.
If present, spawnOpts
are passed as options to fork()
.
In case a callback function then
is provided, it is called with
arguments (error, child) on the child's close
event. (Actually,
the close:nodeback
event from package child-exit-nodeback
.)
.err2dict(error), .dict2err(dict)
These functions translate between Error objects and plain, JSON-able
(dictionary) objects.
Currently they're based heavily on the error-to-json
package,
but implementation may change without notice.
IPC message protocol
- NB: Node v6 IPC channels are JSON-based, so un-JSON-able data may be
transformed or discarded. The
jsonize-loudfail
package can check your data and warn you in advance.
:TODO:
Usage
from test.usage.js:
var logArgs = testlogargs ipcProxy = child = ipcProxy;;child; test; test; test; test; test;
Known issues
- needs more/better tests and docs
License
ISC