david1gp/assets-optimizer

2026-08-16

Language: TypeScript

Link: https://github.com/david1gp/assets-optimizer

This little TypeScript utility scratches a very specific itch that anyone shipping image-heavy websites will recognize instantly: the tedious dance of optimizing images locally and then pushing them to object storage. assets-optimizer processes web project images and syncs them between local folders and Cloudflare R2, turning what is usually a manual multi-step chore into a single command.

What makes this repo interesting is how narrowly focused it is. Rather than being yet another sprawling asset pipeline that tries to replace your build tooling, it targets one specific workflow — the R2 sync loop — and does it in TypeScript so you can actually read the source and understand what's happening to your files. For teams that have adopted Cloudflare's ecosystem (R2 for storage, Workers for compute, Pages for hosting), tooling like this fills a real gap: the official R2 SDK gives you primitives, but not opinionated workflows.

Who would benefit?

The fact that it's TypeScript rather than a shell script also means it's easy to extend — swap in different image processors, add WebP/AVIF variants, or wire it into a CI pipeline. Small utilities like this are exactly the kind of thing that quietly become indispensable in your package.json scripts once you discover them.

Why check it out: A focused, hackable TypeScript tool that turns the tedious local-to-R2 image sync into a single reliable command.

All newsletters