Initialize With npm init

Most JavaScript projects come with a package.json. But what if you want to make a new one? ...

February 12, 2026

Writing the DOM with fs

How can I output the entire DOM to a file in a JavaScript test? ...

January 30, 2026

Rebuilds on Write With Nodemon

I’ve been hacking on a TypeScript file all day, but I need transpiled JavaScript for any testing. How did I reduce cycle time (and mitigate many chances to forget to build at all)? ...

December 30, 2025

NPM Install "Engine Strict"

Suppose your package.json specifies a Node engine of <= 24. Will all engineers on your team use Node 24? Not necessarily, unless you use this one weird trick! ...

December 16, 2025

Learning JavaScript Promises the Feynman Way

Want to learn a tricky topic and sharpen your learning skills at the same time? In this post, I’ll use the Feynman Learning Technique— a method of learning complex things by explaining them simply— with a sprinkle of LLM magic, to deepen my understanding of JavaScript promises. ...

August 25, 2025

Editing in Nodes REPL Editor

The Node REPL has its own editor: node > .editor // Entering editor mode (Ctrl+D to finish, Ctrl+C to cancel) const increment = (array) => array.map(item => item + 1) increment([1,2,3]) Exit and evaluate with Ctrl+D: [ 2, 3, 4 ] I’d use this to experiment with JavaScript API’s without leaving my terminal-based IDE.

July 22, 2025

Why I'm "All In" on TypeScript

I’ve added TypeScript to several projects I’ve worked on. In this post, I’d like to discuss why I think TypeScript is essential and document my expectations around it. ...

March 26, 2025

Load a Dependency in the Node REPL

Exploring your JS dependencies locally is a great way to learn and experiment. Here’s how to load a dependency from your /node_modules directory into the Node REPL. $ node > cn = require('classnames') > cn("always", { never: false, sometimes: true }) 'always sometimes'

July 11, 2024

Absolute Imports in TypeScript and React: A Practical Guide

Absolute imports are an essential developer experience feature for me in any JavaScript application. In this post, I’ll explain what they are, how to use them, and why they matter. ...

May 2, 2023

Sorting Numbers with JavaScript's sort Function

Today in “Let JavaScript Surprise You”: let array = [1, 20, 11, 10, 7, 17, 2]; console.log(array.sort()); > [1, 10, 11, 17, 2, 20, 7] 😳 The numbers are not sorted as we might expect. What’s going on here? From Mozilla’s docs: The default sort order is ascending, built upon converting the elements into strings, then comparing their sequences of UTF-16 code units values. Now this sorting makes sense! Luckily, sort accepts a function, so here’s the sorting we intended: const sortNumbers = (first, second) => first - second console.log(array.sort(sortNumbers)) > [1, 2, 7, 10, 11, 17, 20]

February 10, 2023

Don’t miss my next essay

Hear from me immediately when I post: no ads, unsubscribe anytime.