{"id":13503676,"url":"https://github.com/wasmerio/winterjs","last_synced_at":"2025-05-13T23:04:03.402Z","repository":{"id":196183939,"uuid":"694791993","full_name":"wasmerio/winterjs","owner":"wasmerio","description":"Winter is coming... ❄️","archived":false,"fork":false,"pushed_at":"2025-02-27T17:01:10.000Z","size":226956,"stargazers_count":3123,"open_issues_count":16,"forks_count":55,"subscribers_count":30,"default_branch":"main","last_synced_at":"2025-05-08T04:38:51.188Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://winterjs.org/","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/wasmerio.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2023-09-21T17:46:09.000Z","updated_at":"2025-05-06T15:40:51.000Z","dependencies_parsed_at":"2023-10-21T09:28:24.335Z","dependency_job_id":"60019ca5-4598-40f1-b529-43a915d97a10","html_url":"https://github.com/wasmerio/winterjs","commit_stats":null,"previous_names":["wasmerio/wasmer-winter"],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wasmerio%2Fwinterjs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wasmerio%2Fwinterjs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wasmerio%2Fwinterjs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wasmerio%2Fwinterjs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wasmerio","download_url":"https://codeload.github.com/wasmerio/winterjs/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254040401,"owners_count":22004529,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-07-31T23:00:43.096Z","updated_at":"2025-05-13T23:04:03.339Z","avatar_url":"https://github.com/wasmerio.png","language":"JavaScript","funding_links":[],"categories":["Applications","JavaScript","others"],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n  \u003ca href=\"https://github.com/wasmerio/winterjs\" target=\"_blank\"\u003e\n    \u003cpicture\u003e\n      \u003csource srcset=\"https://raw.githubusercontent.com/wasmerio/winterjs/main/assets/winterjs-logo-white.png\" height=\"128\" media=\"(prefers-color-scheme: dark)\"\u003e\n      \u003cimg height=\"128\" src=\"https://raw.githubusercontent.com/wasmerio/winterjs/main/assets/winterjs-logo-black.png\" alt=\"Wasmer logo\"\u003e\n    \u003c/picture\u003e\n  \u003c/a\u003e\n\u003c/div\u003e\n\nWinterJS is *blazing-fast* JavaScript server that runs Service Workers scripts according to the [Winter Community Group specification](https://wintercg.org/).\n\n**WinterJS is able to handle up to 100,000 reqs/s in a single laptop** (see [Benchmark](./benchmark)).\n\n----\n\n\u003e Note: WinterJS is not officially endorsed by WinterCG, despite sharing \"Winter\" in their name. There are many [runtimes supporting WinterCG](https://runtime-keys.proposal.wintercg.org/), WinterJS being one among those.\n\n## Running WinterJS with Wasmer\n\nThe WinterJS server is published in Wasmer as [`wasmer/winterjs`](https://wasmer.io/wasmer/winterjs).\n\nYou can run the HTTP server locally with:\n\n```shell\nwasmer run wasmer/winterjs --net --mapdir=tests:tests tests/simple.js\n```\n\nWhere `simple.js` is:\n\n```js\naddEventListener('fetch', (req) =\u003e {\n  req.respondWith(new Response('hello'));\n});\n```\n\n## Building from source\n\nWinterJS needs to build SpiderMonkey from source as part of its own build process.\nPlease follow the steps outlined here to make sure you are ready to build SpiderMonkey: https://github.com/wasmerio/mozjs/blob/master/README.md.\n\nYou also need to do this before installing WinterJS with `cargo install`, which builds WinterJS from the source instead of downloading pre-built binaries.\n\nAlso, when building WinterJS in debug mode, you need to have NodeJS and npm installed and run `npm install` beforehand.\nThis is required since debug builds of WinterJS also build the TypeScript code in `src/builtins/internal_js_modules`.\nRelease builds use the existing, pre-compiled `*.js` sources in that directory.\nThis was done to simplify installing WinterJS with `cargo install`.\nIf you update the TypeScript sources, make sure to update the `*.js` sources by building at least once in debug mode and commit the updated `*.js` files.\n\nOnce you can build SpiderMonkey, you simply need to run `cargo build` as usual to build WinterJS itself.\n\n## Running WinterJS Natively\n\nYou can install WinterJS natively with:\n\n```\ncargo install --git https://github.com/wasmerio/winterjs winterjs\n```\n\nOnce you have WinterJS installed, you can simply do:\n\n```shell\nwinterjs tests/simple.js\n```\n\nAnd then access the server in https://localhost:8080/\n\n# How WinterJS works\n\nWinterJS is powered by [SpiderMonkey](https://spidermonkey.dev/), [Spiderfire](https://github.com/Redfire75369/spiderfire) and [hyper](https://hyper.rs/)\nto bring a new level of awesomeness to your Javascript apps.\n\nWinterJS is using the [WASIX](https://wasix.org) standard to compile to WebAssembly. Please note that compiling to WASIX is currently a complex process. We recommend using precompiled versions from [`wasmer/winterjs`](https://wasmer.io/wasmer/winterjs), but please open an issue if you need to compile to WASIX locally.\n\n## Limitations\n\nWinterJS is fully compliant with the WinterCG spec, although the runtime itself is still a work in progress.\nFor more information, see the API Compatibility section below.\n\n# WinterCG API Compatibility\n\nThis section will be updated as APIs are added/fixed.\nIf an API is missing from this section, that means that it is still not implemented.\n\nYou can check a more detailed list here: https://runtime-compat.unjs.io/\n\nThe following words are used to describe the status of an API:\n\n* ✅ Stable - The API is implemented and fully compliant with the spec. This does not account for potential undiscovered implementation errors in the native code.\n* 🔶 Partial - The API is implemented but not fully compliant with the spec and/or there are known limitations.\n* ❌ Pending - The API is not implemented yet.\n\n|API|Status|Notes|\n|:-:|:-:|:--|\n|`console`|✅ Stable|\n|`fetch`|✅ Stable|\n|`URL`|✅ Stable|\n|`URLSearchParams`|✅ Stable|\n|`Request`|✅ Stable|\n|`Headers`|✅ Stable|\n|`Response`|✅ Stable|\n|`Blob`|✅ Stable|\n|`File`|✅ Stable|\n|`FormData`|✅ Stable|\n|`TextDecoder`|✅ Stable|\n|`TextDecoderStream`|✅ Stable|\n|`TextEncoder`|✅ Stable|\n|`TextEncoderStream`|✅ Stable|\n|`ReadableStream` and supporting types|✅ Stable|\n|`WritableStream` and supporting types|✅ Stable|\n|`TransformStream` and supporting types|🔶 Partial|Back-pressure is not implemented\n|`atob`|✅ Stable|\n|`btoa`|✅ Stable|\n|`performance.now()`|✅ Stable|\n|`performance.timeOrigin`|✅ Stable|\n|`crypto`|✅ Stable|\n|`crypto.subtle`|🔶 Partial|Only HMAC, MD5 and SHA algorithms are supported\n\n# Other supported APIs\n\nThe following (non-WinterCG) APIs are implemented and accessible in WinterJS:\n\n|API|Status|Notes|\n|:-:|:-:|:--|\n|[Service Workers Caches API](https://www.w3.org/TR/service-workers/#cache-objects)|✅ Stable|Accessible via `caches`. `caches.default` (similar to [Cloudflare workers](https://developers.cloudflare.com/workers/runtime-apis/cache/#accessing-cache)) is also available.\u003cbr/\u003eThe current implementation is memory-backed, and cached responses will *not* persist between multiple runs of WinterJS.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwasmerio%2Fwinterjs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwasmerio%2Fwinterjs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwasmerio%2Fwinterjs/lists"}