Node.js Weekly Update — 29 September, 2017
Below you can find RisingStack’s collection of the most important Node.js updates, projects & tutorials from this week:
Node v8.6.0 (Current)
Notable changes:
- crypto: Support for multiple ECDH curves.
- dgram: Added
setMulticastInterface()
API +Custom lookup functions are now supported. - n-api: The command-line flag is no longer required to use N-API.
- tls: Docs-only deprecation of parseCertString().
- New Contributors :Welcome Sebastiaan Deckers as a new Collaborator!
Security Issue: Path Validation Vulnerability
The Node.js project released a new version of 8.x this week which incorporates a security fix.
Version 8.5.0 of Node.js is vulnerable. 4.x and 6.x versions are NOT vulnerable.
Google Announced Stackdriver Debugger for Node.js
We’ve all been there. The code looked fine on your machine, but now you’re in production and it’s suddenly not working. But how do you diagnose the root cause of the issue? That’s where Stackdriver Debugger comes in.
Stackdriver Debugger lets you inspect the state of an application at any code location without using logging statements and without stopping or slowing down your applications.
This means users are not impacted during debugging. Using the production debugger, you can capture the local variables and call stack and link it back to a specific line location in your source code. You can use this to analyze your applications’ production state and understand your code’s behavior in production.
How to write clean code for cascaded promises
An in-depth guide about working with Interdependent Promises
As a developer, I’m constantly looking for ways to write cleaner code.
A year ago I published a library called Premiere, designed to facilitate consuming Restful APIs in the frontend with Javascript. I’m now building a v2 of the library and, in this process, I noticed there was room to make the code cleaner, specifically when it comes to Promises.
How to write reliable browser tests using Selenium and Node.js
There are many good articles on how to get started with automated browser testing using the NodeJS version of Selenium. But they fall short of digging into the details of the many gotchas and best practice of automating your browser testing when using Selenium.
This article continues where those other articles leave off, and will help you to write automated browser tests that are far more reliable and maintainable with the NodeJS Selenium API.
Debugging in 2017 with Node.js
While we’ve all used the trusty console.log for debugging our application, Node now has far more powerful debugging capabilities.
Paul Irish demonstrates improved workflows for debugging, profiling and understanding your app using the DevTools Protocol. He also shares more advanced techniques for automating and monitoring Node.
Node8’s util.promisify is so freakin’ awesome!
TLDR;
util.promisify
converts a regular function into a promise.- The function passed to
util.promisify
must follow the NodeJS callback style. The function must pass a callback as the last parameter, and the callback must be the take the following parameters in the following order:(err, value) => { /* … */ }
- Promisifed functions can be used with
await
andasync
to help avoid messy promise chains an introduce a cleaner, saner, way to do asynchronous programming.
Limdu.js — Machine Learning for Node.js
Limdu is a machine-learning framework for Node.js. It supports multi-label classification, online learning, and real-time classification. Therefore, it is especially suited for natural language understanding in dialog systems and chat-bots.
npm install limdu
Limdu is in an “alpha” state — some parts are working (see this readme), but some parts are missing or not tested. Contributions are welcome.
Terminal Kit — Terminal utilities for node.js
A full-blown terminal lib featuring: 256 colors, styles, keys & mouse handling, input field, progress bars, screen buffer (including 32-bit composition and image loading), text buffer, and many more…
Whether you just need colors & styles, build a simple interactive command line tool or a complexe terminal application: this is the absolute terminal lib for Node.js!
It does NOT depend on ncurses.
Reddit thread of the week: Hey Node friends, can we stop posting about politics and start posting about code again?
It would really warm my cold dead heart if we could ignore the stuff that’s happening over on Twitter and such, and let the whole thing just die off.
The opinions of a few people aren’t so important as to rustle our jimmies, plus I love reading about code a lot more than I love reading about politics.
Thanks Node friends, let’s make this place friendlier for each other.
Previously in the Node.js Weekly Update
In the previous Node.js Weekly Update we read about object recognition, the process module, debugging the event loop, and a great modern JS cheatsheet.
We help you to stay up-to-date with Node.js on a daily basis too. Check out our Node.js news page and its Twitter feed!
Originally published at community.risingstack.com on September 29, 2017.