Playwright on Val Town has a few challenges:
To get around needing a full browser, we can use Steel. They let you run browsers on their cloud easily and for free (up to a limit). To get around the file system issue, we can stub node:fs using this small script.
This example is directly from their homepage, with no modification other than adding import "https://esm.town/v/wolf/StubFS/stubFs.ts".
You can set "TMPDIR" to "/tmp" in your environmental variables if you wish not to get warnings about it being unset.