a blog for those who code

Wednesday 31 May 2017

What's New in Node Version 8

In this post we will be discussing about What's New in Node Version 8. Node 8 is the newest version of Node.js released on May 30th which will be using V8 5.8 version but also have forwards ABI compatibility with V8 5.9 and V86.0. Node Version 8 is expected to have better performance than previous versions.

The New and Important things in Node 8 are :

N-API (Node.js API) : N-API or Node.js API will help Node.js Developers to build native addons. APIs which are exposed by N-API are generally used to create and manipulate JavaScript values. N-API does not depend on V8 and is purely maintained as part of Node.js itself.

Async Hooks (async_hooks) : Async Hooks API will allow the developers to track asynchronous requests and handles through their complete lifecycle.

Zero-Filling Buffers and Deprecation Flag : Buffers are now filled with zeros by default thus prevents leak-in data and also increases perdormance. But if you do not want your Buffers to be Zero filled you can use Buffer.allocUnsafe(10) which allocate Buffer instances with uninitialized memory. --pending-deprecation flag will emit a deprecation warning and Buffer methods will now accept Uint8Array as input.

Child Process Improvement : Argument and kill signal validations have been improved in Child Process and also Child Process methods not accept Uint8Array as input.

Console Methods Improvement : Application will not crash when error events will be emitted when using console methods. Thus it will make console.log() and other APIs safe.

Static Error Code : Now all the error generated by Node.js will be assigned a static error code thus will help in debugging the error in much better way.

Redirect Warning in Process : Process warning  output can be redirected to a file using --redirect-warnings command-line argument and also they may now include additional detail.

Streams New Methods : Stream now supports destroy(), _destroy() and _final() APIs.

There are lot of noticeable changes happened in Node.js Version 8 like N-API, Async Hooks, Zero-Filling Buffers which will make Node.js 8 an improved version as far as performance is concerned. The full list can be found on GitHub Node.js ChangeLOG.

Please Like and Share the Blog, if you find it interesting and helpful.

No comments:

Post a Comment