{"id":20498317,"url":"https://github.com/jakeyallop/wasmsharp","last_synced_at":"2026-04-06T08:32:13.236Z","repository":{"id":206572791,"uuid":"573847242","full_name":"JakeYallop/WasmSharp","owner":"JakeYallop","description":"Compile and execute C# code fully within the web browser using Web Assembly, including autocompletion and diagnostics.","archived":false,"fork":false,"pushed_at":"2025-11-16T13:11:22.000Z","size":1991,"stargazers_count":8,"open_issues_count":2,"forks_count":2,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-11-27T12:12:52.529Z","etag":null,"topics":["blazor","blazor-wasm","codemirror","codemirror6","csharp","playwright","pnpm","pnpm-monorepo","roslyn","solidjs","typescript","vanilla-extract","vite","vitest","wasm","webassembly"],"latest_commit_sha":null,"homepage":"https://wasmsharp.pages.dev/","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/JakeYallop.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":"2022-12-03T16:12:55.000Z","updated_at":"2025-11-20T01:37:31.000Z","dependencies_parsed_at":"2024-02-13T20:27:17.098Z","dependency_job_id":"34aaadc5-f670-4e7b-92d0-442c4d3e4886","html_url":"https://github.com/JakeYallop/WasmSharp","commit_stats":null,"previous_names":["jakeyallop/wasmsharp"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/JakeYallop/WasmSharp","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JakeYallop%2FWasmSharp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JakeYallop%2FWasmSharp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JakeYallop%2FWasmSharp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JakeYallop%2FWasmSharp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/JakeYallop","download_url":"https://codeload.github.com/JakeYallop/WasmSharp/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JakeYallop%2FWasmSharp/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31464604,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-05T21:22:52.476Z","status":"online","status_checked_at":"2026-04-06T02:00:07.287Z","response_time":112,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["blazor","blazor-wasm","codemirror","codemirror6","csharp","playwright","pnpm","pnpm-monorepo","roslyn","solidjs","typescript","vanilla-extract","vite","vitest","wasm","webassembly"],"created_at":"2024-11-15T18:13:48.687Z","updated_at":"2026-04-06T08:32:13.230Z","avatar_url":"https://github.com/JakeYallop.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch2 align='center'\u003e\u003csamp\u003eWasmSharp\u003c/samp\u003e\u003c/h2\u003e\n\n\u003cp align='center'\u003e\nCompile and run C# programs locally from your web browser, no server necessary. Diagnostics and completions are supported.\u003c/p\u003e\n\n## Live demo\n\nhttps://wasmsharp.pages.dev/\n\n## Install\n\n```bash\nnpm i @wasmsharp/core\n# or\nyarn add @wasmsharp/core\n# or\npnpm add @wasmsharp/core\n```\n\n## Getting started\n\nCompile and run a basic C# program:\n```typescript\n// downloads and initializes the .NET runtime, loads the Roslyn C# compiler\nconst module = await WasmSharpModule.initializeAsync()\nconst compilation = await module.createCompilationAsync(`\n  using System;\n  Console.WriteLine(\"Hello World!\");\n`)\nconst result = await compilation.run();\nconsole.log(result.success); // true\nconsole.log(result.stdOut); // Hello World!\n```\n\n```typescript\nconst module = await WasmSharpModule.initializeAsync()\nconst compilation = await module.createCompilationAsync(`\n  using System;\n  // intentional error - missing Console in front of \"WriteLine\"\n  WriteLine(\"Hello World!\");\n`)\nconst result = await compilation.run();\nconsole.log(result.success); // false\nconsole.log(result.diagnostics);\n/*\n[\n  {\n    \"id\": \"CS0103\",\n    \"message\": \"The name 'WriteLine' does not exist in the current context\",\n    \"location\": {\n      \"start\": 3,\n      \"end\": 12,\n      \"length\": 9,\n      \"isEmpty\": false\n    },\n    \"severity\": \"Error\"\n  }\n]\n*/\n```\n\n## Troubleshooting\n \nWeb worker mode (the default mode) requires a HTTPS URL (or localhost in some browsers). Disable web worker mode using `disableWebWorker: true`:\n```ts\nconst module = await WasmSharpModule.initializeAsync({\n  disableWebWorker: true\n})\n```\n\n## Development setup\n\nThis project uses pnpm. Installation instructions for pnpm can be found [here](https://pnpm.io/installation).\n\n### Prerequisites\n* pnpm\n* .NET 10.0 SDK or greater\n  * Ensure the `wasm-tools` workload is installed. It can be installed using\n  ```\n  dotnet workload install wasm-tools\n  ```\n\n### Install packages\n```\npnpm i\n```\n\n### Build all required depedencies to run the playground (C# project + vite plugins)\n```\npnpm init-playground-deps\n```\n\n### Run the playground\n\n```\npnpm start\n```\n\n### Building @wasmsharp/core\n\n```\npnpm build:core\n```\n\n### Run tests\n\n```\npnpm test\n```\n\n## Deploying the Playground\n\n### Build the playground\n```\npnpm --filter playground build\n```\n\nBuild is created in the playground/dist/ folder.\n\n### Serve the production build of the playground\n```\npnpm serve\n```\n\nBuilding and serving the playground has a shortcut command:\n```\npnpm build-serve\n```\n\nBuilding @wasmsharp/core, building the playground, and then previewing it has a shortcut command:\n```\npnpm all\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjakeyallop%2Fwasmsharp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjakeyallop%2Fwasmsharp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjakeyallop%2Fwasmsharp/lists"}