Native popover API in HTML

Native popover API in HTML

  • April 18, 2024

Popovers have been a problem that was typically solved by using a third-party solution. But that is no longer the case. We now have a native popover API in HTML supported by all browsers (Firefox added preview browser support on 16th April 2024 in version 125). Let us take a...

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

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

  • April 10, 2024

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 to load environment variables from .env files directly without using third-party packages. While it is great to see first-class support, some caveats remain. Let us look at how it works. Assuming that...

Object destructuring in TypeScript

Object destructuring in TypeScript

  • March 28, 2024

Object destructuring is a powerful ES 6 feature that can help developers write cleaner code. It allows us to extract properties from a JavaScript object into variables. If you are unfamiliar with it, read our post about object destructuring to know more about what is possible using it. When it...

Improve git clone performance in a CI pipeline

Improve git clone performance in a CI pipeline

  • March 19, 2024

Have you felt particularly annoyed by the time it takes to clone a large repository, especially one with a huge commit history? This post will discuss a simple but powerful technique to significantly improve git clone performance. The solution is called shallow cloning, which uses the –depth=1 flag with git...

How to keep the screen awake using JavaScript

How to keep the screen awake using JavaScript

  • March 5, 2024

Some new features in JavaScript are great to see, and the wake lock API is one of those. It allows us to interact with the host system and can help the developer instruct the operating system to keep the screen awake using JavaScript! This can be particularly useful for cases...

Using RegEx groups for Search & replace  in VS Code

Using RegEx groups for Search & replace in VS Code

  • February 29, 2024

VS Code has a nifty tool for doing search and replace using RegEx, which I prefer using whenever doing bulk updates. It has saved me quite a few times while refactoring across multiple files. Let us look at how search & replace using RegEx groups works in Visual Studio Code....

How To Fix ReferenceError: __dirname is not defined

How To Fix ReferenceError: __dirname is not defined

  • February 15, 2024

I recently tried to use __dirname inside a ES module. It turns out, that I cannot. It throws an error. So let us see how To Fix ReferenceError: __dirname is not defined. For people who do not know what it is, let us first discuss what __dirname is. __dirname is a global variable in Node.js...