I recently decided to do some more exploration of NestJS, as its a framework I’ve been interested in for a few years, and even dabbled in a bit. I have used it for a small project and built some services with it back in 2021 to test out how well we could implement a microservice […]
Category: Typescript
How I Built and Published My First Angular Library
I’ve always been curious about how writing code for a library differs from writing code for regular application. How is it different from writing normal application code. Is the setup more complicated, because you need to transpile to different versions? Is it vastly different between a frontend (React, Angular, etc.) library versus a NodeJS library? […]
Speed vs robustness when coding in Typescript
At the risk of sounding like a cliché I thought I’d share some thoughts on striking a balance between “speed” and “robustness”, working as a Typescript developer. I’ve always been a firm believer in picking the right tool for the job, whether that is applying the appropriate programming language, framework, library or delivery vehicle (ie. […]
What are Javascript “pure functions”?
Ever hear of ‘pure functions’ in Javascript – and Typescript by extension – and wonder what they are? Pure functions, can simply be described as functions that do not modify their inputs or create side effects. This is important because in Javascript where everything is dynamic by default, it is easy to completely change the […]
Converting a Typescript project from CJS to ESM – the ultimate how-to
The dreaded CommonJS (CJS) to EcmaScript Modules (ESM) conversion. As the Javascript ecosystem continues to evolve and we continue to standardize, one unfortunate side-product for us NodeJS users, is the conversion to ESM.Admitted, as most things Node, since it isn’t running in the browser context we don’t have to convert to ESM, and it likely […]
To framework, or not to framework, that is the decision
Lately I’ve found myself with renewed urge to learn new things through building new. Usually that starts with a good idea “damn, it would be cool to build X!” – you know the feeling. But being a bit of a perfectionist (it’s something I’m working on), the dreams of features quickly becomes consumed by other […]
What the F are dotfiles and why should I care?
I’m sure we’ve all shared this sort of experience: You grab your recently delivered brand new shiny computer. You’re excited! It’s time to get that baby running, so you plug in the charger and quickly boot it up. Oh snap. It’s faaaaast! Nice! After sprinting through the system configuration and creating a user account, you […]
When to use .d.ts type files for global types
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 […]
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 […]