JavaScript

Generating a QR code using Node.js

I was preparing a slide deck for a hackathon and decided to put in a QR code to allow people…

5 months ago

How to clear the global npx cache

I have been using npx a lot lately, especially whenever I want to use a CLI tool. It is an…

5 months ago

How To Get The Hash of A File In Node.js

While working on a project, I wanted to do an integrity check of a file that I was referencing. So,…

7 months ago

Node.js 20.6 adds built-in support for .env files

Node.js 20.6 added built-in support for the .env file. This is an excellent addition to the platform and gives us the ability…

7 months ago

Object destructuring in TypeScript

Object destructuring is a powerful ES 6 feature that can help developers write cleaner code. It allows us to extract…

7 months ago

How to keep the screen awake using JavaScript

Some new features in JavaScript are great to see, and the wake lock API is one of those. It allows…

8 months ago

How To Fix ReferenceError: __dirname is not defined

I recently tried to use __dirname inside a ES module. It turns out, that I cannot. It throws an error. So let us…

9 months ago

How to detect caps lock with JavaScript

The need to verify and notify the user if the Caps Lock key is on is fairly common. It is…

9 months ago

Partial Matching in Jest

Jest has the ability to check for partial matches on arrays and objects. Let us see how to do partial…

1 year ago

JSON.parse(): Fixing ‘SyntaxError: “[object Object]” is not valid JSON’

SyntaxError: "[object Object]" is not valid JSON: usually happens when the value being passed to JSON.parse is not a string…

1 year ago
Advertisements