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

Explore the Library

Find interesting tutorials and solutions for your problems.