@live-codes/vb-wasm
v0.1.1
Published
VB.NET in the browser: the real Roslyn compiler running on .NET WebAssembly.
Downloads
348
Maintainers
Readme
@live-codes/vb-wasm
VB.NET in the browser: the real Roslyn compiler (Microsoft.CodeAnalysis.VisualBasic) running on .NET WebAssembly. No server, no network round-trips — the code is compiled and run inside the page (or a Web Worker).
This package ships uncompressed assets only. CDNs (jsDelivr et al.) compress responses themselves, so the .br/.gz siblings a .NET publish emits were dropped to stay well under jsDelivr's 150 MB package limit.
Usage
import { createVbRunner } from "@live-codes/vb-wasm";
const runner = createVbRunner({
baseUrl: "https://cdn.jsdelivr.net/npm/@live-codes/vb-wasm/",
});
const { ok, output, errors, warnings } = await runner.run(
'Module P\n Sub Main()\n Console.WriteLine("Hello from VB.NET")\n End Sub\nEnd Module',
);Or with a plain script tag (no bundler):
<script src="https://cdn.jsdelivr.net/npm/@live-codes/vb-wasm/vb-compiler.js"></script>
<script>
VbRunner.baseUrl = "https://cdn.jsdelivr.net/npm/@live-codes/vb-wasm/";
VbRunner.run(
'Module P\n Sub Main()\n Console.WriteLine("hi")\n End Sub\nEnd Module',
).then((r) => console.log(r.output));
</script>BaseUrl must point at this package folder. Open demo.html for a working editor, or see the repository README for the full API.
