Marcus is a fullstack JS developer. He’s passionate about the hapi framework for Node.js and loves to build web apps and APIs. Creator of Futureflix and the “learn hapi” learning path.

How to Allow Trailing Commas (Comma-Dangle) With Typescript-ESLint

ESLint comes with support to require or disallow trailing commas. This option is also known as “comma-dangle”. Trailing commas are supported in JavaScript by ECMAScript v5. Here’s a simple example: const futurestudio = { team: ['Marcus', 'Norman', 'Christian'], } The comma after team: ['Marcus', 'Norman', 'Christian'], is a trailing comma. This tutorial …

Continue Reading

JavaScript Map — Transform to an Object

A previous tutorial showed you how to create a JavaScript Map instance from an existing object. This time we’re doing it the other way around: transforming a JavaScript map into a plain object. {{outline}} Create a JavaScript Object From a Map Modern JavaScript engines ship with the Object.fromEntries( …

Continue Reading

JavaScript Map — Create From Object

The ECMAScript 2015 specification introduced a Map class. A Map instance provides convenient methods around key-value-pairs. Objects in JavaScript are key-value-pairs as well. Yet, you can’t pass an existing object to the map constructor. This tutorial shows you how to create a JavaScript map from an existing object. {{outline} …

Continue Reading

Ensure a Positive Number in JavaScript or Node.js

In a recent project, we needed to calculate differences between data points. Each data point represented an amount of money. The difference between the two data points should always be a positive number in context with prices going up or down. This tutorial shows you how to always retrieve a …

Continue Reading

Ubuntu/Debian — How to Shutdown a Machine

Occasionally you need to shut down or reboot your Linux servers. The Linux operating system comes with the built-in shutdown command. This command allows you to power off or reboot a computer. This tutorial shows you how to shut down or reboot a Linux machine. {{outline}} Shutdown Your Ubuntu/Debian …

Continue Reading

nginx — How to Fix Unknown "connection_upgrade" Variable

You may encounter the $connection_upgrade variable in your nginx configuration when working with Websockets or using an nginx config generator. The $connection_upgrade variable isn’t available by default. Yet, it’s a recommended practice to define and use it in your reverse proxy settings. This tutorial shows you …

Continue Reading

nginx — How to Fix “ssl” Directive Is Deprecated, Use “listen … ssl”

When updating nginx to a newer version, you may run into deprecated configurations. Nginx uses a YAML-like definition format to create configurations. This format evolves over time by adding, removing, or changing keywords. This tutorial shows you how to fix nginx’s “ssl” deprecation warning telling you to use “listen …

Continue Reading
Page 1 of 46

Explore the Library

Find interesting tutorials and solutions for your problems.