The Node.js Update #Week 42 of 2019. 18 October

By Ferenc Hamori

The Node.js Update #Week 42 of 2019. 18 October

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

Latest Node.js Updates here: 10.16.3 LTS / 12.12.0 Current

First, let’s start with “official” Node news:

Node v12.12.0 Current Released. Changelog:

  • build: Add –force-context-aware flag to prevent usage of native node addons that aren’t context aware
  • deprecations: Add documentation-only deprecation for process._tickCallback()
  • esm: Using JSON modules is experimental again
  • fs: Introduce opendir() and fs.Dir to iterate through directories
  • process: Add source-map support to stack traces by using --enable-source-maps
  • tls:
    • Honor pauseOnConnect option
    • Add option for private keys for OpenSSL engines

Node.js 13.0.0 (Current)

Did you know that you can already check out Node 13?

GitHub Package Registry Beta Announcement

With the GitHub Package Registry you can safely publish and consume packages within your org.

npm is moving back to its developer roots, founder says

According to Isaac Schlueter, the right strategy for “building a sustainable engine behind an open source labor of love” might well be a return to npm’s roots.

Awesome Node.js & JavaScript Tutorials:

Build a Stripe Billing onboarding flow with Node and React

In this article we will be going over the steps needed to integrate Stripe Billing with an onboarding flow using Node.js and React. In the guide we will be:

  • Configuring a Stripe account with a pricing strategy we will be using in this example
  • Setting up a Route in ExpressJS which will expose the pricing strategy to the front-end
  • Setting up a React front-end which will handle the onboarding flow, utilizing Stripe Elements for checkout

Build Command-Line Spinners in Node.js

Practice your Node.js-terminal skills by building your own CLI spinners.

Coloring Your Terminal Using Nodejs

Chalk has been the most widely used library for adding color effects on our Node CLI project. Most people are unaware of how Sindre Sorhus implemented the library, so I decided to take my time out to write about it.

In this post, we will see how to write colors to our terminal using Nodejs.

The Power of JSON.STRINGIFY replacer parameter

I had an interesting problem that melted my brain a bit. Let me share what I have learned and maybe save you a few moments when you come across a similar challenge.

Continuation Local Storage for easy context passing in Node.js

Recently I’ve been working on a Node.js project where we needed to keep track of which requests were generating calls to some other pieces of code. Passing a request identifier around was not viable since it would require to change too many APIs.

We solved the problem using cls-hooked, a small package that uses the async_hooks experimental Node.js API to implement Continuation Local Storage.

The perfect architecture flow for your next Node.js project

We can all agree that our project architecture is extremely important, and we can also declare a few points that can help us determine what this architecture must help us do:

  • Achieve clean and readable code
  • Achieve reusable pieces of code across our application
  • Help us to avoid repetitions
  • Make life easier when adding a new feature into our application

Interesting JS & Node Discussions:

7 Simple but Tricky JavaScript Interview Questions

Do people really ask questions like these?

npm is moving back to its developer roots, founder says

Hard times for npm when github prepares to step in.

Should We Rebrand JavaScript?

Recruiters are still confusing Java and JavaScript…

Source:: risingstack.com