winterjs package icon
wasmer/winterjs

wasi

Public
wasmer run wasmer/winterjs

WinterJS

A blazing-fast JavaScript server that runs Service Workers scripts according to the Winter Community Group specification.

WinterJS is able to handle up to 100,000 reqs/s in a single laptop (see Benchmark).

Note: WinterJS is not officially endorsed by WinterCG, despite sharing "Winter" in their name. There are many runtimes supporting WinterCG, WinterJS being one among those.

Running WinterJS with Wasmer

The WinterJS server is published in Wasmer as wasmer/winterjs.

You can run the HTTP server locally with:

wasmer run wasmer/winterjs --net --mapdir=tests:tests tests/simple.js

Where simple.js is:

addEventListener('fetch', (req) => {
  req.respondWith(new Response('hello'));
});

Running WinterJS Natively

You can run WinterJS natively by simply doing

cargo run -- tests/simple.js

And then access the server in https://localhost:8080/

How WinterJS works

WinterJS is powered by SpiderMonkey, Spiderfire and hyper to bring a new level of awesomeness to your Javascript apps.

WinterJS is using the WASIX standard to compile to WebAssembly. Please note that compiling to WASIX is currently a complex process. We recommend using precompiled versions from wasmer/winterjs, but please open an issue if you need to compile to WASIX locally.

Limitations

WinterJS is fully compliant with the WinterCG spec, although the runtime itself is still a work in progress. It is not recommended to use WinterJS in production yet. For more information, see the API Compatibility section below.

WinterCG API Compatibility

This section will be updated as APIs are added/fixed. If an API is missing from this section, that means that it is still not implemented.

The following words are used to describe the status of an API:

  • βœ… Stable - The API is implemented and fully compliant with the spec. This does not account for potential undiscovered implementation errors in the native code.
  • πŸ”Ά Partial - The API is implemented but not fully compliant with the spec and/or there are known limitations.
  • ❌ Pending - The API is not implemented yet.
APIStatusNotes
consoleβœ… Stable
fetchβœ… Stable
URLβœ… Stable
URLSearchParamsβœ… Stable
Requestβœ… Stable
Headersβœ… Stable
Responseβœ… Stable
Blobβœ… Stable
Fileβœ… Stable
FormDataβœ… Stable
TextDecoderβœ… Stable
TextDecoderStreamβœ… Stable
TextEncoderβœ… Stable
TextEncoderStreamβœ… Stable
ReadableStream and supporting typesβœ… Stable
WritableStream and supporting typesβœ… Stable
TransformStream and supporting typesπŸ”Ά PartialBack-pressure is not implemented
atobβœ… Stable
btoaβœ… Stable
performance.now()βœ… Stable
performance.timeOriginβœ… Stable
cryptoβœ… Stable
crypto.subtleπŸ”Ά PartialOnly HMAC, MD5 and SHA algorithms are supported

Other supported APIs

The following (non-WinterCG) APIs are implemented and accessible in WinterJS:

APIStatusNotes
Service Workers Caches APIβœ… StableAccessible via caches. caches.default (similar to Cloudflare workers) is also available.The current implementation is memory-backed, and cached responses will not persist between multiple runs of WinterJS.

The JavaScript runtime that brings JavaScript to Wasmer Edge.


Github
More packages
The JavaScript runtime that brings JavaScript to Wasmer Edge.
Javascript WCGI handler
JS Service Worker Wasmer starter package
JS Service Worker Wasmer starter package
JS Service Worker Wasmer starter package
JS Service Worker Wasmer starter package
Javascript WCGI hello world example.
Javascript echo server using winter-js.
The JavaScript engine that powers Safari
Syrus Akbary
Syrus Akbary
Syrus Akbary
Syrus Akbary
🟨 JavaScript HTTP server compiled to WASM and running on Wasmer!
Jacob Hummer
Jacob Hummer
Jacob Hummer
Jacob Hummer

Making software universally accessible