The Node.js Update - #Week 38 - 28 September, 2018

Below you can find RisingStack's collection of the most important Node.js updates, tutorials & announcements from this week.

Rethinking JavaScript Test Coverage

TLDR: You can now expose coverage output through Node.js by setting the environment variable NODE_V8_COVERAGE to the directory you would like coverage data output in. The tool c8 can be used to output pretty reports based on this coverage information.

testcoverage

Understanding and building your own tiny blockchain in JavaScript

Despite blockchain tech usually having whitepapers freely available and more forums, discord and IRC channels, and developer groups than we know what to do with, the basic structure of a blockchain can be pretty opaque. Let’s take a look at how we’d build a very simple block blockchain to help visualize how transactions are added.

blockchain-with-ys

Getting to know Node’s child_process module

"Node.js is one of the most powerful platforms for managing resources in our computer and has became more and more popular over the years ever since it was released. As much as it’s great, and with all the love and respect that I have for it, Node.js alone is not enough.Accordingly, I’ve decided to write an article about Node’s child_process module — a utility module which provides you with functions that can create and manage other processes."

forking-nodejs

Testing your Node.js API with Dredd

In this article, we are going to present a technology stack aimed to bridge the gap between front-end and back-end developers, enable us to document the API and continuously test it once it’s implemented.

The stack presented in this article consists of the following:

  • Dredd — API testing tool utilizing API Blueprint and Swagger API Description formats
  • API Blueprint — Specification language allowing us to document our APIs in Markdown-like syntax
  • Drakov — Tool that can use API Blueprint description of our API and set up a mock server to host the endpoints
  • Examples in this post will be shown using simple Node.js API with Express middleware on top of it.

Authentication Made Easy with Auth0: Part 1

Through example, we will demonstrate how to use Auth0 to secure a Node.js (Express) API that is accessed by a single page application.

auto0-nodejs

Clustering in NodeJs — Performance Optimization

Node.js single-threaded nature is by default using a single core of a processor for code execution. Therefore NodeJs introduced a cluster module to spawn processes. “Cluster” was introduced to scale an application execution on multiple processor cores by creating worker processes. Worker processes share a single port, therefore, requests are routed through a shared port.

nodejs-clusters

How to build a Facebook Messenger chatbot with Node.js and Dialogflow

Many chatbots leverage Natural Language Processing (NLP) to interpret the intent of a customer’s input, allowing the bot to give an accurate response. Implementing NLP in your bot can be pretty difficult, but there are several platforms that make it much easier.

fb-chatbot-small-talk

Of these platforms, Dialogflow (formerly known as Api.ai) and Wit.ai are the most popular today. They both provide several NLP functions that parse user input and match them to the right response without any coding.

Announcing TypeScript 3.1

Let’s take a look at what this release of TypeScript brings us. Feel free to use the list below to jump around this post a bit.

  • Mappable tuple and array types
  • Easier properties on function declarations
  • Version redirects for TypeScript via typesVersions
  • Refactor from .then() to await

Meet Cogear.JS — a modern static website generator

Cogear.JS is a static websites generator built with Node.JS (9.x or higher) and based on Webpack (v4.6). It's inspired by Jekyll and others, but built on the top of the latest frontend technologies.Provides awesome hot reloading experience in development mode.

The Top Ten Reasons to Attend Node+JS Interactive

Node+JS Interactive is less than a month away!

vancouver-nodejs

Workshops, more workshops, everyone likes workshops: Along with the amazing keynotes, panels and sessions, we will have hands-on workshops that cover everything from building effective communication techniques in open source community environments to mastering serverless with JS architecture.

How does your company use Node.js? (I'll show you mine if you show me yours)

We had an interesting & insightful thread on r/node this week:

"Hi, long time lurker here. I personally find it difficult to get a read on patterns businesses use for node.js. Obviously it's easy to find patterns that are common throughout open source projects, but these are mostly frameworks rather than large applications intended to be hosted and run somewhere

So, let's compare notes! I'm going to give a short summary of the technical domain of the company I work for, how many employees and then an overview of patterns we use within the code and if I'm lucky some of you will too :)"

--

For more Node.js content, follow us on Twitter @RisingStack.

In case you need guidance with Docker, Kubernetes, Microservices or Node.js, feel free to ping us at [email protected]!