Skip to content

mmkal/workert

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

workert

TypeScript compiler running in a Cloudflare Worker. Proof of concept.

Compiles TS to JS on the edge, executes in a sandboxed dynamic worker, returns result.

Demo: https://workert-compiler-mmkal.iterate.workers.dev

Usage

curl -X POST https://workert-compiler-mmkal.iterate.workers.dev \
  -d '{"code": "async function codemode() { return 1 + 1 }"}'
# {"success":true,"result":2}

Or visit the URL in browser for a simple UI.

Deploy your own

bun install
bun run deploy

Requires Alchemy and Cloudflare credentials.

Development

bun install
bun test        # run tests
bun dev     # start local dev server

How it works

  • Bundles @ts-morph/bootstrap + TypeScript compiler with Bun
  • Compiled code runs in isolated worker with no network access

License

Apache 2.0

About

POC of TypeScript compiler running in a Cloudflare Worker

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published