toString can be set in JavaScript

A while ago, I wrote that you can use .toString() to reflect about user-defined functions in the JavaScript runtime. There’s a catch— this value can be set, making it not a reliable way to reflect the function. ...

September 9, 2026 · 1 min · Jake Worth

Read Node's Process Versions

Node has a key process.versions that can tell us a lot about itself. Here’s one its many keys, telling me the V8 version of my Node with the -p / --print flag: node --print process.versions.v8 14.6.202.34-node.28 See node --print process for more.

September 9, 2026 · 1 min · Jake Worth

JavaScript Reflection Preserves Comments

In JavaScript reflection with .toString(), comments are preserved. const hello = () => { // returns "Hello" return 'Hello'; }; hello.toString(); // '() => {\r // returns "Hello"\r return "Hello";\r}' Note the comment in the returned string.

September 9, 2026 · 1 min · Jake Worth

Building a Pitchfork-Style Loading Skeleton

Today, after waiting for an album review to load, I built something small: my own take on the Pitchfork aggregate review loading experience. ...

September 2, 2026 · 3 min · Jake Worth

Link to Local Package With npm link

When developing a local Node module, we might want to point another project’s package.json at the local module. Here’s how you do that. ...

September 2, 2026 · 1 min · Jake Worth

Don't Use npm init on an Existing Project

npm init is a nice tool for initializing a package.json. Today I learned that you should not use it on an existing JavaScript project! ...

August 25, 2026 · 1 min · Jake Worth

Enumerate on promise resolved

For the golfers out there, we can combine these two lines into one: const items = await getCollection(); return items.sort(); This doesn’t work because sort() is being called on the promise returned by getCollection(): return await getCollection().sort(); // `sort()` runs on the Promise Instead, wrap the await expression in parentheses so sort() is called on the resolved value: return (await getCollection()).sort(); // `sort()` runs on the resolved array Promise documentation - MDN

July 24, 2026 · 1 min · Jake Worth

4321 is Astro

Astro’s default port is 4321. Like Vite, this project is trying to convey its (rocket-launch) branding, even in this small detail. ...

July 21, 2026 · 1 min · Jake Worth

Node's Timeout _destroyed Private Method

Node Timeout timers have a private boolean attribute called _destroyed. It tells you if the function has been cleared: timer._destroyed; ...

July 20, 2026 · 1 min · Jake Worth

Uncheck Buttons With JavaScript

Today I used JavaScript to mass-unsubscribe from a website’s email notifications. Here’s the code, followed by what I did and why. document .querySelectorAll('[role="switch"]') .forEach((element) => element.click()); ...

July 20, 2026 · 1 min · Jake Worth