Articles tagged in: Node.js

How to Destructure a Dynamic Key in JavaScript or Node.js

In some situations, you want to dynamically access a property in a JavaScript object. You typically access dynamic properties using obj[key]. In situations where you want to access multiple properties, you would need to have multiple assignments for the individual properties. The good thing: you can also use JavaScript …

Continue Reading

Node.js — Check If a Directory Is Empty

You want a solid and convenient experience when working with the file system in Node.js. The file system comes with its own challenges, like space limitations and access restrictions. Typically you also need to ensure a given state. For example, you want to delete all files from a given …

Continue Reading

Add Week(s) to a Date in JavaScript or Node.js

When interacting with dates in JavaScript you sometimes want to provide shortcuts. Like adding a week to a given date. Or moving today’s meeting two weeks into the future (keeping the day and time). That’s what this tutorial is about: adding a single week or multiple weeks to …

Continue Reading

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
Page 1 of 31

Explore the Library

Find interesting tutorials and solutions for your problems.