The Node.js Update #Week 21 of 2019. 24 May
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.js v12.3.0 & 12.3.1 Released
Changelog:
- esm: Added the
--experimental-wasm-modules
flag to support WebAssembly modules - process: Log errors using util.inspect in case of fatal exceptions
- repl: Add
process.on('uncaughtException')
support - stream: Implemented Readable.from async iterator utility
- tls:
- Expose built-in root certificates
- Support
net.Server
options - Expose
keylog
event on TLSSocket - worker: Added the ability to unshift messages from the MessagePort
- deps:
- Fix handling of +0/-0 when constant field tracking is enabled
- Fix os.freemem() and os.totalmem correctness
- src: Fix v12.3.0 regression that prevents native addons from compiling
Node.js Open-Source Monitoring Tools
In this article, the author explains how you can add monitoring to your Node.js application with 5 different open-source tools. They may not have full-blown features like Sematext or Datadog, but keep in mind they’re open-source products and can hold their own just fine.
Tools discussed:
- Appmetrics
- Express Status Monitor
- Prometheus and Docker
- Clinic.js
- PM2
How to build a blazing fast GraphQL API with Node.js, MongoDB and Fastify
This tutorial is part two of a four part series, which aims to take you from scratch to deploying a fully functional full stack application.
In this part we will revisit the models, controllers and routes from part one and then integrate GraphQL into the application. As a bonus we will also use Faker.js to create some fake data and seed the database.
How to Server-Side render a Create React App with ForrestJS
In this step-by-step tutorial you are going to take a Create React App (CRA) app, and turn it into a fully featured Universal PWA with server-side rendering, served by an ExpressJS server.
NOTE: If you just want to enjoy a ready-to-use app, type this in a terminal:
npx forrest run my-new-universal-cra -p 8080
Node.js file streams explained!
In today’s post, we’re continuing the discovery of Node.js (v10.15.3 LTS) APIs! Last time, we’ve discussed the File System (FS) API used to read and write files, but not all of it. We haven’t yet talked about quite a few things, including streams, which present a great, alternative way of reading and writing data.
Instead of doing everything at once (even if it’s done asynchronously), streaming data is much more efficient and performant way — especially when working with large files. Your files are read or written chunk by chunk, rather than all at once. They have a few FS API methods dedicated to them, but also a whole API of their own called Stream API. And it’s all that goodness that we’ll explore in this post!
3 Approaches for Using the Google Sheets API in Node.js: A Tutorial
I wanted a place where people could easily log their progress towards coding publicly, so people could keep them accountable. That’s exactly what Progression Page does; it allows each member to log their daily progress in terms of what they’re learning, how long, and how often in a Google sheet, in addition to their skills, goals, and more.
Things that this article will go over:
- How to authenticate OAuth2 in Node.js
- How to connect with the Google Sheets API with Node to create a Google Spreadsheet database through 3 approaches
- How to integrate data from the API into an Express.js application
Things that this article will not go over:
- How to style or deploy a web page
- How to use Node.js or Express.js from the ground up
- How to use the API across other back-end languages
The 80/20 Guide to Promises in Node.js
Promises are a built-in concurrency primitive that’s been part of JavaScript since ES6 in 2015. The Promise class has been included in Node.js since v4.0.0. That means, unless you’re on an unmaintained version of Node.js, you can use promises without any outside libraries.
Promises have replaced callbacks as the fundamental concurrency primitive for Node.js. Promises are the basis for async/await in Node.js, so your options are limited to promises, callbacks, or non-standard userland libraries. Now that the Node.js core APIs are starting to adopt promises, Node.js-style callbacks are fast becoming obsolete.
Originally published at https://community.risingstack.com on May 24, 2019.