If you don’t already know what a .d.ts file is, I recommend reading my other post on the topic. Writing and managing types for a Typescript project is a cumbersome issue, and one that is often handled differently from project to project. A common pattern that has evolved is to “place types where they are […]
Category: Typescript
How to get started with Typescript
So, you’ve decided that Javascript is the language you want to pursue and learn. Upon googling “how to learn javascript” you quickly start seeing “Typescript” appearing again and again. Intrigued you wonder “what is Typescript? Is that something I need to know? Should I learn that instead?”. A bit worried you continue your quest for […]
How to work with union types that can be undefined
Ever struggled with figuring out how to deal with undefined? Or spent a good cup of coffee (and a half) to stop the Typescript compiler from screaming at you? In Typescript we often come across values that can have multiple values, called union types, and in some cases one of those values is undefined. If […]
“I love Typescript, but I hate the configuration”
Back upright, posture checked, fingers have just been cracked, you’ve got some good music playing and you’re ready to sit down and start coding on your new cool idea. Whilst ideas begin to unfold in your mind and you’re about to burst with creativity you envision “hey, this would be a cool opportunity to get […]
How to manage consistent types using extract
As we start unfolding Typescript and start to maintain an ever-increasing amount of types in our codebase, we might want to start doing things smarter at some point. I’m a very pragmatic person and that makes me subscribe to the idea of DRY; especially when it comes to managing types. I really do not want […]
Enabling ESM with TS, without the headaches
This post was written from an optimistic standpoint, enabling ESM and TS on a new project, making it a straight forward thing to do.If you’re migrating an existing codebase, see my recent article on that topic right here, as that’s a much harder thing to do. Are you wanting to get on the latest trend […]
How to properly use a .d.ts files
If you’ve ever need a global type to be available or perhaps already have a few, then There are several cases in Node where we may want to extend interfaces, a common such example is when using the library passport that often recommends appending a user object to our express Request object. Using Typescript, this […]
Taking the ‘Patch’ Out of Monkeypatching: Adding Properties in TypeScript
Let’s dive in. It’s a common scenario. You’re coding away in TypeScript, enjoying the safety net of static types. Then, you hit a snag. You need to attach a new property to an existing object, and TypeScript, in all its type-safe glory, is telling you, “Nope, sorry, that’s not going to happen.” In your case, […]
How to fix “Uncaught ReferenceError: process is not defined” error
Updated November 5th, 2025 Ever run into this dreaded issue when working with Javascript or – preferably – Typescript?Nothing is more frustrating than happily coding away, deciding you want to increase the security abstraction layer a bit – or perhaps you subscribe to the 12 Factor App – only to get met with this error. […]
The dreaded JS-to-TS Migration: Partial progress or full migration?
I write a lot about Typescript. I write a lot about why I think it’s better than Javascript. And perhaps I’ve convinced you too! Maybe you want to start converting some JS projects to TS and see what the fuzz is all about. The only thing blocking you is… How the hell do I get […]