AngleSharp.Wasm 1.0.0

dotnet add package AngleSharp.Wasm --version 1.0.0
                    
NuGet\Install-Package AngleSharp.Wasm -Version 1.0.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="AngleSharp.Wasm" Version="1.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="AngleSharp.Wasm" Version="1.0.0" />
                    
Directory.Packages.props
<PackageReference Include="AngleSharp.Wasm" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add AngleSharp.Wasm --version 1.0.0
                    
#r "nuget: AngleSharp.Wasm, 1.0.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package AngleSharp.Wasm@1.0.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=AngleSharp.Wasm&version=1.0.0
                    
Install as a Cake Addin
#tool nuget:?package=AngleSharp.Wasm&version=1.0.0
                    
Install as a Cake Tool

logo

AngleSharp.Wasm

CI GitHub Tag NuGet Count Issues Open CLA Assistant

AngleSharp.Wasm extends the core AngleSharp library with the ability to run WebAssembly. This repository is the home of the source for the AngleSharp.Wasm NuGet package.

Documentation

Further documentation is available in the docs folder:

Basic Configuration

If you just want a configuration that works you should use the following code:

var config = Configuration.Default
    .WithWasm(); // from AngleSharp.Wasm

This will register everything related for running WebAssembly.

Host Imports

If your module imports host functions, register imports via WithWasmImports(...):

var config = Configuration.Default
    .WithWasm()
    .WithWasmImports(_ =>
    {
        return new[]
        {
            new WasmImportFunction(
                "host",
                "answer",
                Array.Empty<WasmValueType>(),
                new[] { WasmValueType.Int32 },
                _ => 41),
        };
    });

DOM / JS Integration

When using a scripting setup that discovers DOM-annotated members (for example, AngleSharp.Js with registered assemblies), AngleSharp.Wasm exposes a WebAssembly surface under window.WebAssembly.

Available bridge capabilities include:

  • Compile module bytes
  • Instantiate compiled modules
  • Inspect module imports / exports / custom sections
  • Access instance exports and invoke exported functions

Typical flow:

var module = WebAssembly.Compile(context.Current!, wasmBytes);
var instance = WebAssembly.Instantiate(context.Current!, module);
var result = instance.Invoke("answer");

Runtime Backend

The current default backend uses Wasmtime and targets modern .NET runtimes.

Target Frameworks

The current package targets net8.0 and net10.0.

Features

  • Runtime registration via WithWasm()
  • Optional host import registration via WithWasmImports(...)
  • Default Wasmtime backend
  • Module metadata extraction
    • exports()
    • imports()
    • customSections(name)
  • Instance export access
    • exports lookup by export name
    • export key enumeration
  • Export invocation helpers
    • instance.Invoke(...)
    • WasmJsExportedFunction.Invoke(...)
  • Multi-target support for net8.0 and net10.0

Current Scope and Limitations

AngleSharp.Wasm currently provides a practical subset of the WebAssembly JS API.

  • Bridge methods are synchronous from the caller perspective.
  • Promise-based namespace operations are not currently exposed.
  • validate(...) and streaming APIs are not yet implemented.
  • Compile options such as builtins / imported string constants are not yet implemented.
  • Non-function exports are currently represented as descriptors (name, kind) rather than full Memory / Table / Global / Tag objects.

See Spec Coverage Matrix for a section-by-section status overview.

Participating

Participation in the project is highly welcome. For this project the same rules as for the AngleSharp core project may be applied.

If you have any question, concern, or spot an issue then please report it before opening a pull request. An initial discussion is appreciated regardless of the nature of the problem.

This project has adopted the code of conduct defined by the Contributor Covenant to clarify expected behavior in our community.

For more information see the .NET Foundation Code of Conduct.

.NET Foundation

This project is supported by the .NET Foundation.

License

AngleSharp.Wasm is released using the MIT license. For more information see the license file.

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.0 42 7/31/2026
1.0.0-beta.15 34 7/31/2026
1.0.0-beta.13 35 7/29/2026
0.13.0 38,876 6/12/2021
0.13.0-beta.11 31 7/28/2026
0.13.0-beta.9 38 7/28/2026
0.13.0-beta.8 33 7/28/2026
0.13.0-alpha-4 563 6/12/2021
0.13.0-alpha-3 452 6/12/2021
0.13.0-alpha-2 425 6/12/2021
0.13.0-alpha-1 435 4/22/2021