diff --git a/website/api.html b/website/api.html index 59bb15a4ac..3b3bcdbaf5 100644 --- a/website/api.html +++ b/website/api.html @@ -13,6 +13,7 @@
+ Node provides a tridirectional popen(3)
facility.
+ It is possible to stream data through the child's stdin
,
+ stdout
, and stderr
in a fully non-blocking
+ way.
+
new node.Process(command)
command
. For example:
+ var ls = new Process("ls -lh /usr");+
process.pid
process.onOutput = function (chunk) { };
stdout
.
+ At the moment the received data is always a string and utf8 encoded.
+ (More encodings will be supported in the future.)
+
+ If the process closes it's stdout
, this callback will
+ be issued with null
as an argument. Be prepared for this
+ possibility.
+
process.onError = function (chunk) { };
stderr
.
+ At the moment the received data is always a string and utf8 encoded.
+ (More encodings will be supported in the future.)
+
+ If the process closes it's stderr
, this callback will
+ be issued with null
as an argument. Be prepared for this
+ possibility.
+
process.onExit = function (exit_code) { };
process.write(data, encoding="ascii");
stdin
. The second
+ argument is optional and specifies the encoding: possible values are
+ "utf8"
, "ascii"
, and "raw"
.
+ process.close();
stdin
stream.process.kill(signal=node.SIGTERM);
node.SIGTERM
. The standard
+ POSIX signals are defined under the node
namespace (e.g.
+ node.SIGINT
, node.SIGUSR1
).
+ node.fs