On February 6, a new version of Node.js v0.12 was released. It was a long and difficult process, not without loss for NodeJS, as a result of which
io.js was separated from the main branch, but, nevertheless, the list of innovations is quite impressive. Let's have a look.
Streams 3
As the developers promise, the implementation of threads now works as expected. And the most important thing is that the old APIs entered in v0.10 have not changed.
Added cork / uncork mechanism for applications that write to the stream synchronously several times.
.cork () includes buffering for all entries in the stream,
.uncork () also flushes the entire buffer.
HTTP
The maxSockets parameter is no longer limited to 5. By default, it is set to Infinity. So now the developer, or the operating system, can decide how many simultaneous connections the application can support.
')
Also changed the behavior of KeepAlive connections. Now they will remain open until their timeout expires or the remote host breaks the connection. Thus, queries for extending the lifetime of a socket and libraries using this mechanics will stop working.
Cluster
Added round robin mode. It will now work by default. In this mode, the wizard will accept new connections and distribute them across worker processes.
child_process
Added spawnSync / execSync methods for spawning a child process. In my opinion, a very convenient feature for writing any system scripts. There will be no need to fence noodles from callbacks
Buffer
An updated memory allocation mechanism for buffers, the developers promise to reduce memory consumption and speed up the work of the garbage collector with buffers.
Crypto
The
crypto.setEngine (engine [, flags]) method has been
added , allowing to use its own cryptographic algorithms.
Added methods for encrypting / de-encrypting with public and private keys (currently only RSA is supported).
crypto.publicEncrypt (public_key, buffer)
crypto.privateDecrypt (private_key, buffer)Added Certificate class.
VM
Very interesting module for executing code in a sandbox. Subtleties and details can be seen in the
documentation .
From the sad. This release, as expected, was released with version V8 3.28.73. This means that there are no new features from ES6 Harmony. This, by the way, is the main reason why the guys from
io.js went to make their fork.
In general, the changes I described are far from all, more details can be seen
here and
here .
As always, you can download the new Node.js on the
official website .
Thanks for attention.