Blog (page 4)

JSON Anything

Did you know that JSON.stringify and JSON.parse can take more than one argument? Perhaps like me you’ve done: To output readable JSON with 2 space formatting — the correctly amount of whitespace. But what is that null all about? Surely I’ve researched this before and forgotten. JSON basics Standard JSON values include the primitives: boolean null number string And then array and object collections […]

Just-in-Time JavaScript

Static site generators are cool but they require a build step. Frameworks like SvelteKit use Vite. For development, Vite basically does the build in the background. It caches and compiles to disk. It uses fancy tricks like hot module replacement to streamline the dev experience. Spicy. When it’s time to deploy to production there is a […]

Get in Line, Deno!

I’ve updated my Deno Tail Lines module to improve performance. See my original blog post for a quick intro. Reading a file backwards is trickier than it sounds! The Deno standard library has a new TextLineStream. This is a useful addition. However, If you only want the last ten lines, for example, you have to skip […]

XML Streamify

I’ve only gone and published an XML parsing library! It’s called XML Streamify on GitHub and it works like this: This example outputs blog post titles from my RSS feed. The parse function is an async generator in front of a custom TransformStream. parse will yield nodes as the XML document if fetched as parsed. This allows you to […]

The Final Off-Canvas Navigation: Revisited

So I may have used the word “final” rather ambitiously when I blogged “The Final Off-Canvas Navigation?” two years ago. At least I left the door open with a question mark? I’ve since made big changes to the implementation. The New (New) Version Checkout my new demo on CodePen. All the good stuff remains like focus state, keyboard […]

Storage APIs: Downloading Files for Offline Access

In my ongoing adventure to build a personal media web app I keep finding new web APIs to make it more awesome. I’ve adopted the Internationalization API for natural sorting and relative dates and the Media Session API for native integration. Next I’m improving my use of file storage APIs to download and cache audio files […]

Adios Netlify!

I’m moving my website hosting from Netlify to Cloudflare Pages! If you can read this I was successful. If not… oh dear! I first tried Netlify back in January 2020. I wrote some first impressions and experimented with Netlify functions. I initially planned to host projects on both Netlify and Cloudflare for a few weeks before […]

Buy me a coffee! Support me on Ko-fi