Okojo.JavaScript.Embedding 0.2.0-preview.2

This is a prerelease version of Okojo.JavaScript.Embedding.
dotnet add package Okojo.JavaScript.Embedding --version 0.2.0-preview.2
                    
NuGet\Install-Package Okojo.JavaScript.Embedding -Version 0.2.0-preview.2
                    
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="Okojo.JavaScript.Embedding" Version="0.2.0-preview.2" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Okojo.JavaScript.Embedding" Version="0.2.0-preview.2" />
                    
Directory.Packages.props
<PackageReference Include="Okojo.JavaScript.Embedding" />
                    
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 Okojo.JavaScript.Embedding --version 0.2.0-preview.2
                    
#r "nuget: Okojo.JavaScript.Embedding, 0.2.0-preview.2"
                    
#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 Okojo.JavaScript.Embedding@0.2.0-preview.2
                    
#: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=Okojo.JavaScript.Embedding&version=0.2.0-preview.2&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=Okojo.JavaScript.Embedding&version=0.2.0-preview.2&prerelease
                    
Install as a Cake Tool

Okojo.JavaScript.Embedding

Okojo.JavaScript.Embedding provides runtime composition and host integration contracts for the Okojo.JavaScript ECMAScript engine. It does not select a thread, task scheduler, event loop, worker host, or message serializer.

using Okojo.JavaScript.Embedding;

using var runtime = JsRuntime.Create();
Console.WriteLine(runtime.MainRealm.Evaluate("1 + 2"));

Add Okojo.Hosting, Okojo.WebPlatform, or another profile package when host policy and platform APIs are needed.

Additional same-agent realms created with runtime.CreateRealm() share object references without copying. When a browser document is replaced, runtime.ReleaseRealm(childRealm) removes the runtime's registry ownership. Saved functions/objects and pending jobs remain valid; the host must detach its document services separately. The main realm remains owned until runtime disposal. Each realm has an independent module map; set options.ModuleSourceLoader in runtime.CreateRealm(options => ...) to override its loader. Module URLs and import.meta.url are unchanged. Cached modules do not independently root a released realm through the agent, while retained namespace/function references remain valid. agent.Modules diagnostics and invalidation default to the main realm; use their explicit realm overloads to inspect or invalidate a child document's map.

Browser hosts can configure JsRealmOptions.GlobalThisObject while keeping realm-local global bindings. The host integration JsWindowProxy supports same-agent retargeting and detachment; create it in a long-lived anchor realm. See host global-this for the contract and example.

Product Compatible and additional computed target framework versions.
.NET 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 (5)

Showing the top 5 NuGet packages that depend on Okojo.JavaScript.Embedding:

Package Downloads
Okojo.Reflection

Reflection-based CLR interop extensions for Okojo runtimes.

Okojo.WebPlatform

Portable web-platform APIs such as fetch, timers, workers, and host-installed globals for Okojo.

Okojo.WebAssembly

Backend-agnostic WebAssembly integration APIs for Okojo runtimes.

Okojo.Hosting

Hosting helpers, schedulers, queues, and worker infrastructure for Okojo runtimes.

Okojo.DotNet.Modules

.NET ecosystem module-resolution and cache primitives for Okojo embedders.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.2.0-preview.2 0 9/21/2026
0.2.0-preview.1 80 9/12/2026