FeaturesTemplatesShowcaseTownie
AI
BlogDocsPricing
Log inSign up
wolf
wolfPlaywrightDemo
Example of using Playwright with Steel on Val Town
Public
Like
1
PlaywrightDemo
Home
Code
3
README.md
hackerNewsDemo.ts
main.ts
Branches
1
Pull requests
Remixes
2
History
Environment variables
2
Settings
Val Town is a collaborative website to build and scale JavaScript apps.
Deploy APIs, crons, & store data – all from the browser, and deployed in miliseconds.
Sign up now
Code
/
Code
/
Search
README.md

Playwright on Val Town

Playwright on Val Town has a few challenges:

  • You can't run a browser on Val Town, since Val Town can only run Deno Typescript code
  • Playwright requires file system access to work (it makes an artifacts temp dir)

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.

Code
README.mdhackerNewsDemo.tsmain.ts
Go to top
X (Twitter)
Discord community
GitHub discussions
YouTube channel
Bluesky
Product
FeaturesPricing
Developers
DocsStatusAPI ExamplesNPM Package Examples
Explore
ShowcaseTemplatesNewest ValsTrending ValsNewsletter
Company
AboutBlogCareersBrandhi@val.town
Terms of usePrivacy policyAbuse contact
© 2025 Val Town, Inc.