Node version 0.8 includes significant performance improvements and changes to core APIs. It provides up to 10% faster execution speed and up to 4x faster file I/O due to changes in the V8 engine and underlying system calls. Many core Node modules like http, net, and child_processes see major API changes and added functionality. New features like domains and clusters are introduced to make asynchronous code and load distribution across cores easier.
14. Lots more changes and additions
process
• buffer
◦ process.stdin.on('keypress') will not be emitted by default, as it's an internal API. Use the keypress module now.
◦ 'utf16le' encoding.
◦ process.stdin.pipe(dest) will automatically call process.stdin.resume().
• child_process
• cluster
◦ silent option to child_process.fork() - stdout and stderr won't be shared with parent.
◦ cluster.fork() no longer return a child_process.fork() object use cluster.fork().process to get the object.
◦ .disconnect() when using child_process.fork() this will allow the child to die gracefully.
◦ the 'death' event on the cluster object is renamed to 'exit'.
◦ stdio option for child_process.spawn() - configuration of child's stdio (file descriptors).
◦ the kill() method is renamed to destroy().
◦ detached option for child_process.spawn() - make the child a process group leader (see docs)
◦ the CLUSTER_WORKER_ID env is now called CLUSTER_UNIQUE_ID, but you should not have used that anyway.
◦ child.send() can now send net.Server and net.Socket as second argument.
◦ workers now kill themselves when they accidentally lose their connection to the master.
• cluster
• http
◦ 'fork', 'online', 'listening', and 'setup' events.
◦ http.Server emits 'connect' event instead of 'upgrade' when the CONNECT method is requested.
◦ Worker object which is provided from cluster.workers (in the master) or cluster.worker (in the worker).
◦ http.ServerResponse sends Date: header by default. You can disable it by setting response.sendDate to false.
◦ env optional argument to cluster.fork().
◦ http.ClientRequest emits 'connect' event instead of 'request' when the CONNECT method is responded.
◦ cluster.setupMaster() and cluster.settings.
• net
◦ cluster.disconnect() and worker.disconnect().
◦ net.listen(socketPath) no longer unlinks the socket unless you call server.close(). Automatic unlinking was ◦ worker.id what there before was internally known as workerID.
subject to race conditions in multi-process setups. Also applies to http.listen(socketPath). ◦ worker.suicide flag set when worker disconnect or die, indicate if this was an accidental death.
• child_process • crypto
◦ arguments and options arguments of child_process.fork() became an option. ◦ crypto.getDiffieHellman().
◦ the 'exit' event is now emitted right after the child process exits. It no longer waits for all stdio pipes to be closed. ◦ cipher.setAutoPadding() and decipher.setAutoPadding().
◦ the 'close' event was added that has is emitted after the child has exited and all the stdio pipes are closed. ◦ ciphers option to crypto.createCredentials().
• readline • domain
◦ arguments of rl.createInterface became an option as rl.createInterface(options) but still took an old style ◦ see http://nodejs.org/docs/v0.8.0/api/domain.html
• fs
15. Lots more changes and additions
process
l f:
• buffer
rse
◦ process.stdin.on('keypress') will not be emitted by default, as it's an internal API. Use the keypress module now.
ou
◦ 'utf16le' encoding.
◦ process.stdin.pipe(dest) will automatically call process.stdin.resume().
ry
• child_process
• cluster
ad fo wiki/
◦ silent option to child_process.fork() - stdout and stderr won't be shared with parent.
◦ cluster.fork() no longer return a child_process.fork() object use cluster.fork().process to get the object.
re de/
◦ .disconnect() when using child_process.fork() this will allow the child to die gracefully.
◦ the 'death' event on the cluster object is renamed to 'exit'.
Go .com/joyent d-v0.8 /no
◦ stdio option for child_process.spawn() - configuration of child's stdio (file descriptors).
◦ the kill() method is renamed to destroy().
◦ detached option for child_process.spawn() - make the child a process group leader (see docs)
◦ the CLUSTER_WORKER_ID env is now called CLUSTER_UNIQUE_ID, but you should not have used that anyway.
◦ child.send() can now send net.Server and net.Socket as second argument.
◦ workers now kill themselves when they accidentally lose their connection to the master.
• cluster
• http
git hub 0.6 -an
◦ 'fork', 'online', 'listening', and 'setup' events.
n-v
◦ http.Server emits 'connect' event instead of 'upgrade' when the CONNECT method is requested.
tps: // wee
◦ Worker object which is provided from cluster.workers (in the master) or cluster.worker (in the worker).
◦ http.ServerResponse sends Date: header by default. You can disable it by setting response.sendDate to false.
ht et
◦ env optional argument to cluster.fork().
◦ http.ClientRequest emits 'connect' event instead of 'request' when the CONNECT method is responded.
es-b
◦ cluster.setupMaster() and cluster.settings.
ang
• net
◦ cluster.disconnect() and worker.disconnect().
I-ch
◦ net.listen(socketPath) no longer unlinks the socket unless you call server.close(). Automatic unlinking was ◦ worker.id what there before was internally known as workerID.
AP
subject to race conditions in multi-process setups. Also applies to http.listen(socketPath). ◦ worker.suicide flag set when worker disconnect or die, indicate if this was an accidental death.
• child_process • crypto
◦ arguments and options arguments of child_process.fork() became an option. ◦ crypto.getDiffieHellman().
◦ the 'exit' event is now emitted right after the child process exits. It no longer waits for all stdio pipes to be closed. ◦ cipher.setAutoPadding() and decipher.setAutoPadding().
◦ the 'close' event was added that has is emitted after the child has exited and all the stdio pipes are closed. ◦ ciphers option to crypto.createCredentials().
• readline • domain
◦ arguments of rl.createInterface became an option as rl.createInterface(options) but still took an old style ◦ see http://nodejs.org/docs/v0.8.0/api/domain.html
• fs
18. highlights
Domains provide a way to handle multiple different IO
operations as a single group.
Keeps context unlike“process.on(‘uncaughtException’)”
Disabled by default
25. highlights
Take advantage of multi-core system to handle load
easily create a network of processes that share common
ports
setup and manage master-slave worker relationships
Disabled by default
30. Was intended to make child_process.fork() in a thread,
rather than a full process.
Make it cheaper to spin up new child node instances as well
as fast message-passing using shared memory.