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.

Node.js — How to Reset and Empty an Array

When emptying an array in JavaScript/Node.js you’ll surely think of reassigning your array’s value to a new array. There’s another way to reset an array: set the length to zero. Let’s have a look at both ways. {{outline}} Assign an Empty Array A common …

Continue Reading

Node.js — How to Create an Empty File

You may know the touch command from your command line which creates an empty file if it doesn’t exist. This tutorial shows you how to implement touch in Node.js. You’ll implement a function that creates an empty file using Node.js. You’ll walk through an asynchronous …

Continue Reading

Node.js — Run Async Functions/Promises in Parallel

With the release of Node.js v8, async functions became an integral component. Async functions provide a simpler API around promises by removing (most) of the callback-y code. The combination of async/await and promises is powerful, but you have to be careful not going too sequential. This tutorial shows …

Continue Reading

Explore the Library

Find interesting tutorials and solutions for your problems.