The Node.js Update #Week 13 - 29 March, 2019.

RisingStack
Node.js Collection
Published in
4 min readMar 29, 2019

Below you can find a collection of the most important Node.js updates, tutorials & announcements from this week — curated by RisingStack’s Node.js Developers.

Node v11.13.0 (Current) Released

Notable Changes:

crypto: Allow deriving public from private keys

events: Added a once function to use EventEmitter with promises

tty:

  • Added a hasColors method to WriteStream
  • Added NO_COLOR and FORCE_COLOR support

v8: Added v8.getHeapSnapshot and v8.writeHeapSnapshot to generate snapshots in the format used by tools such as Chrome DevTools

worker: Added worker.moveMessagePortToContext. This enables using MessagePorts in different vm.Contexts, aiding with the isolation that the vm module seeks to provide

C++ API:

  • AddPromiseHook is now deprecated. This API was added to fill a use case that is served by async_hooks, since that has Promise support
  • Added a Stop API to shut down Node.js while it is running

New ESM implementation in Node.js

“The new ESM implementation just landed in @nodejs core

Still behind a flag, still work to be done… but an amazing accomplishment.

Thank you so much everyone who has helped with getting this over the finish line.”

— via @MylesBorins

Introducing experimental integrity policies to Node.js

A recent experimental feature for introducing integrity policies landed in Node.js core 11.8.0. This capability, shipped in non LTS version yet, provides integrity checks for a Node.js runtime when modules are being loaded, in order to verify that the modules code haven’t been tampered with.

The continuous work on building security features into Node.js is promising and we will surely see more of it in the near future. Keep in mind that the integrity policy feature is still experimental and also only available from Node.js 11.8.0.

Why should I use a Reverse Proxy if Node.js is Production-Ready?

Every day Node.js-powered web applications happily handle billions of requests. Most of the largest companies in the world are powered in some manner by Node.js. To say that Node.js is Production-Ready is certainly an understatement.

Node.js Reverse Proxy

However, there’s one piece of advice which has held true since Node.js’s inception: one should not directly expose a Node.js process to the web and should instead hide it behind a reverse proxy. But, before we look at the reasons why we would want to use a reverse proxy, let’s first look at what one is.

The shortest way to conditional insert properties into an object literal

const obj = {
...condition && { prop: value },
};

This is perfectly acceptable and executable JavaScript.

Surprised? Shaken up? Aghast? Maybe just intrigued?

Bear with me for few lines, I’ll try to explain what’s going on thanks to the ECMAScript Language Specification. It won’t be so boring, I new Promise().

Clone Medium on Node.js and React.js

TL;DR: In this article, we are going to build a Medium.com clone using various technologies like Node.js and React.

Building a Point of Sale system with Node & React

Build the front and back end of a real-time application with React and Node!

Part 1 (Back End):

  • Frameworks description
  • Building the Node app from scratch
  • Testing with Postman

Part 2 (Front End):

  • Creating a Template React app.
  • Creating Routes and Views.

Using Java libraries from a Node.js application. Testcontainers example.

The Java ecosystem has a very neat library for using Docker containers programmatically: Testcontainers. Testcontainers is an excellent way to manage all your infrastructure dependencies during tests.

Testcontainers is a Java library, and it’s a perfect candidate to be used from other languages. The JVM languages have some sort of interop with Java so they can use it naturally, but other languages can’t. GraalVM can solve this problem.

Here’s how you use Testcontainers from a node.js application in a few straightforward steps.

Golang for Node.js Developers

This guide full of examples is intended for people learning Go that are coming from Node.js, although the vice versa can work too. This is not meant to be a complete guide and it is assumed that you’ve gone through the Tour of Go tutorial.

This guide is meant to be barely good enough to help you at a high level understand how to do X in Y and doing further learning on your own is of course required.

Node.js v6 is moving to EOL status in a month.

“As a reminder, @nodejs v6 is moving to EOL status in just 34 days.

If you’ve still got @nodejs v6 in production, you need to start working on upgrading ✨ today “✨- via @bitandbang

Originally published at community.risingstack.com on March 29, 2019.

--

--

RisingStack
Node.js Collection

Consulting, training & development services — with a strong focus on JavaScript, Node.js, DevOps, Microservices & Kubernetes | contact: info@risingstack.com