download esm packages

Oct 20, 2023

Simonw, via mbostock, had the neat idea to write a script to download ESM packages from npm and rewrite them to use relative imports, which allows you to import them as modules without running a compile step on your JS.

It's very simple; and hrbrmstr rewrote it in go:

read the code to see how it just downloads the code and uses a few regexes to rewrite the imports. Clever.

↑ up