All Projects → cloudflare → worker-emscripten-template

cloudflare / worker-emscripten-template

Licence: Apache-2.0, MIT licenses found Licenses found Apache-2.0 LICENSE_APACHE MIT LICENSE_MIT
No description, website, or topics provided.

Programming Languages

javascript
184084 projects - #8 most used programming language
c
50402 projects - #5 most used programming language

👷 worker-emscripten-template

A template for kick starting a Cloudflare worker project with emscripten

index.js is the content of the Workers script.
main.c is the c source code that calls into the stb image resizer library.
build.js holds the command we use to call emscripten.
webpack.config.js holds the webpack config we use to bundle the emscripten output together with your script.

This template requires Docker for providing the emscripten build environment. While we believe this provides the best developer experience, if you wish to not use Docker you can delete the check for docker and the docker parts of the build command in build.js. Note this means you must have emscripten installed on your machine.

Wrangler

This template requires version >=1.6.0 of Wrangler

$ wrangler generate myapp https://github.com/cloudflare/worker-emscripten-template
🔧   Creating project called `myapp`...
✨   Done! New project created /path/to/myapp

To demo you can use wrangler dev

$ wrangler dev
👂 Listening on http://localhost:8787
$ curl http://localhost:8787/600*400.jpg?width=100

Shoutout to Surma for his webpack-emscripten-wasm gist that was instrumental in getting this working!

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].