Articles tagged in: Node.js



Node.js — Read File Content as String

You may need to read files from a local hard disk in your Node.js project. A typical use case when interacting with files is to read the content as a string. This tutorial shows you how to read a file’s content as a string using Node.js {{outline} …

Continue Reading

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

Explore the Library

Find interesting tutorials and solutions for your problems.