Saturday, 4 April 2026

TypeScript in CodePen

Can you do TypeScript in CodePen?  

The question is valid as CodePen reveals three containers, one for HTML, one for CSS and one for JavaScript, in its default interface.

To enable TypeScript input, go to Settings, select JavaScript preprocessor and choose TypeScript. Other available preprocessors are LiveScript, CoffeeScript (billed as a "simple and elegant way" to write JavaScript) and Babel.

Note that CodePen will run TypeScript without type-checking errors blocking execution.

Friday, 3 April 2026

Bun - The JavaScript Runtime used by All (Cool Cats)

Bun is a fast JavaScript runtime. It's website is bun.sh (where the suffix sh denotes a St Helena domain). Bun is built from scratch to "serve the modern JavaScript ecosystem".

A major selling point of Bun is it starts fast and runs fast. It extends the performance-minded JS engine built for Safari known as JavaScriptCore. Fast start times leads to fast apps like Claude Code CLI.

Bun also boasts "cohesive DX" (developer experience) with a package manager, test runner and bundler all included.

Design-wise it has been designed to be a drop-in replacement for Node.js. Thousands of Node.js and Web APIs have been implemented in Bun like fs, path and Buffer.

Bun's ambition is to run most of the world's server-side JavaScript.

CodePen

CodePen is a web environment to experiment with front-end code.

Thursday, 2 April 2026

Inside the Claude Code CLI

On 31 March 2026, Anthropic's CLI tool Claude Code that lets you interact with Claude for software engineering tasks from the command line - edit files, search codebases, manage git workflows and more - had its src directory leaked revealing TypeScript code with UI written in React and Ink (React for interactive command-line applications). It uses the Bun runtime - a fast JavaScript, TypeScript and JSX toolkit.

Wednesday, 18 March 2026

PowerShell Inspired Installations using iwr

iwr is the short form for Invoke-WebRequest which can be used in PowerShell via its aliases as iwr, wget or curl.

npm and pnpm - the differences

npm, the Node package manager, can be incredibly disk-inefficient. pnpm was created to be (literally) a "performant npm" sometimes also called "painless npm".

The difference lies in each others' ability to store packages. 

npm duplicates node_modules per project, resulting in a huge disk footprint, whereas pnpm uses a global store and stores links to the same, resulting in 70-90% space savings.

node_modules is a directory in a NodeJS project storing third-party libraries and dependencies.

Tuesday, 17 March 2026

TypeScript for Java and C# Programmers

There is a good tutorial here.

An important point to note is that while TypeScript adds static typing to JavaScript, the underlying runtime is the same as JavaScript.

Recall that with static typing, the type of every variable and expression is checked before the program runs.  This enables errors to be caught at compile-time rather than run-time (in dynamic typing, by contrast, types are enforced only when code executes).

TypeScript is not a "mandatory" OOP language, in the same way as Java or C# (wherein the class is the basic unit of code organization - all data and behaviour is contained in a class). In JavaScript, and by extension TypeScript, this constraint is not present.  Functions can live anywhere. Avoiding OOP hierarchies where possible tends to be the preferred programming model.

In the spirit of not mandating classes for general programming, static classes are unnecessary in JavaScript. Singletons are also generally not used.