Languages
Background
Workers is a polyglot platform. You can write Workers in JavaScript, TypeScript, or any programming language that compiles to WebAssembly.
JavaScript / TypeScript
The Workers platform fully supports JavaScript standards, as defined by TC39 (ECMAScript). Cloudflare recommends writing Workers using JavaScript or TypeScript, and publishes type definitions to GitHub and npm (npm install -D @cloudflare/workers-types
).
Language | Template |
---|---|
JavaScript | cloudflare/workers-sdk/templates/worker |
TypeScript | cloudflare/workers-sdk/templates/worker-typescript |
Resources
- Quickstarts – More example repos to use as a basis for your projects
- TypeScript type definitions
- JavaScript and web standard APIs
- Tutorials
WebAssembly (Wasm)
WebAssembly (abbreviated as “Wasm”) is a binary format that many languages can be compiled to. This allows you to write Workers using programming language beyond JavaScript, such as Rust, C, C++, Go and more.
Resources on WebAssembly
Compile languages to JavaScript
You can write Workers with any language that can compile to JavaScript, including the languages below.
Refer to the Cloudflare Workers announces broad language support blog post for more information.