Marcus

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 — Handling `fs.Stats` Constructor is Deprecated

You may notice a deprecation warning in your terminal that the fs.Stats constructor is deprecated. Node.js deprecated the public fs.Stats constructor in version 22.0.0: (node:17560) [DEP0180] DeprecationWarning: fs.Stats constructor is deprecated. (Use `node --trace-deprecation ...` to show where the warning was created) This tutorial …

Continue Reading

Bun — Detect the Version at Runtime

Sometimes you need to detect the version running your code at runtime. You may need this to ensure that your code runs with a required version of Bun. This tutorial shows you how to detect the Bun version, that runs your code, at runtime. {{outline}} Determine the Bun Version Running …

Continue Reading

Arguments vs. Parameters in Programming

We often use the terms argument and parameter when discussing code. We use both terms interchangeably, but actually, they are not. Both terms describe different things. An argument describes a value passed during a function invocation. It’s the value you’re passing down to a function. A parameter describes …

Continue Reading

Node.js — How to Fix ESM Error “Directory import is not supported resolving ES modules imported”

ECMAScript modules are an official standard describing a format on how to write reusable JavaScript code. Browsers used ECMAScript modules and Node.js had their own module loading implementation: CommonJS. Node.js added full ESM support starting from version 12. At the time of writing this tutorial, developers migrate their …

Continue Reading

JavaScript — Using the new Array Grouping Methods

Grouping array items is a common task in programming. You probably wrote a JavaScript grouping function multiple times in your projects. And in the future, you don’t necessarily have to do it again. JavaScript is getting support for array grouping with the static Object.groupBy and Map.groupBy methods. …

Continue Reading

JavaScript — Create Array from AsyncIterable

JavaScript has supported async iterators since ES2018. All modern browser versions handle async iterables and Node.js can do it since version 10.x. Async iterables have a positive aspect and a drawback at the same time: you need to consume them to know the result. That means you can’ …

Continue Reading

Explore the Library

Find interesting tutorials and solutions for your problems.