A listener on this event should not try to perform
I/O since the process will forcibly exit in less
than microsecond. However, it is a good hook to
- perform constant time checks of the module"s
+ perform constant time checks of the module's
state (like for unit tests).
+
The parameter +code+ is the integer exit code
share structure with the original object(s).
+
Undefined properties are not copied. However, properties inherited from the
-object"s prototype will be copied over.
+object's prototype will be copied over.
=== System module
If you created the promise (by doing +new process.Promise()+) then call
+emitSuccess+ to emit the +"success"+ event with the given arguments.
+
-(+promise.emit("success", arg1, arg2, ...)+ should also work, but doesn"t at
+(+promise.emit("success", arg1, arg2, ...)+ should also work, but doesn't at
the moment due to a bug; use +emitSuccess+ instead.)
+promise.emitError(arg1, arg2, ...)+ ::
+
*IMPORTANT* +promise.wait()+ is not a true fiber/coroutine. If any other
promises are created and made to wait while the first promise waits, the
-first promise"s wait will not return until all others return. The benefit of
+first promise's wait will not return until all others return. The benefit of
this is a simple implementation and the event loop does not get blocked.
Disadvantage is the possibility of situations where the promise stack grows
infinitely large because promises keep getting created and keep being told
=== Child Processes
Node provides a tridirectional +popen(3)+ facility through the class
-+process.ChildProcess+. It is possible to stream data through the child"s +stdin+,
++process.ChildProcess+. It is possible to stream data through the child's +stdin+,
+stdout+, and +stderr+ in a fully non-blocking way.
==== +process.ChildProcess+
+child.write(data, encoding="ascii")+ ::
-Write data to the child process"s +stdin+. The second argument is optional and
+Write data to the child process's +stdin+. The second argument is optional and
specifies the encoding: possible values are +"utf8"+, +"ascii"+, and
+"binary"+.
+child.close()+ ::
-Closes the process"s +stdin+ stream.
+Closes the process's +stdin+ stream.
+child.kill(signal="SIGTERM")+ ::
+
The first time +sendBody+ is called, it will send the buffered header
information and the first body to the client. The second time
-+sendBody+ is called, Node assumes you"re going to be streaming data, and
++sendBody+ is called, Node assumes you're going to be streaming data, and
sends that seperately. That is, the response is buffered up to the
first chunk of body.
includable in other programs.
The standalone REPL is called +node-repl+ and is installed at
-+$PREFIX/bin/node-repl+. It"s recommended to use it with the program
++$PREFIX/bin/node-repl+. It's recommended to use it with the program
+rlwrap+ for a better user interface. I set
------------------------------------
alias node-repl="rlwrap node-repl"
- Others. Look in +deps/+ for what else is available.
Node statically compiles all its dependencies into the executable. When
-compiling your module, you don"t need to worry about linking to any of these
+compiling your module, you don't need to worry about linking to any of these
libraries.
-To get started let"s make a small Addon which does the following except in
+To get started let's make a small Addon which does the following except in
C++:
-----------------------------------------------------
exports.hello = "world";