Jroc.Core
0.12.26
dotnet add package Jroc.Core --version 0.12.26
NuGet\Install-Package Jroc.Core -Version 0.12.26
<PackageReference Include="Jroc.Core" Version="0.12.26" />
<PackageVersion Include="Jroc.Core" Version="0.12.26" />
<PackageReference Include="Jroc.Core" />
paket add Jroc.Core --version 0.12.26
#r "nuget: Jroc.Core, 0.12.26"
#:package Jroc.Core@0.12.26
#addin nuget:?package=Jroc.Core&version=0.12.26
#tool nuget:?package=Jroc.Core&version=0.12.26
Jroc.Core
Jroc.Core provides in-memory JavaScript compilation for .NET applications
whose scripts are not known at build time. It ships Jroc.Compiler.dll and
the compiler dependencies.
The consumer entry point is Jroc.JrocInMemoryCompiler: compile runtime source
to PE/PDB bytes, or compile and evaluate it in a disposable in-memory module.
Choose your workflow
jroc: compile and run from the command line.Jroc.SDK: compile known JavaScript during MSBuild, then call the generated assembly's typedImport/RunAPIs.Jroc.Core: compile scripts supplied at runtime in memory.
Jroc.Runtime supplies execution
support. Official releases publish all four packages together; keep versions
aligned when using them in one application.
Install
For a .NET 10 application that compiles and executes runtime-supplied scripts:
<ItemGroup>
<PackageReference Include="Jroc.Core" Version="VERSION" />
<PackageReference Include="Jroc.Runtime" Version="VERSION" />
</ItemGroup>
Replace VERSION with the same released version for both packages.
Compile and execute in memory
using Jroc;
// Replace with source selected by the application at runtime.
var sourceText = "exports.add = (left, right) => left + right;";
var path = Path.Combine(Path.GetTempPath(), "jroc-input", "math.js");
using var module = JrocInMemoryCompiler.CompileAndLoadModule(
new JrocInMemoryCompileRequest(path) { SourceText = sourceText });
Console.WriteLine(module.Exports.Invoke("add", 1d, 2d));
The entry path supplies identity and dependency-resolution context. It need
not exist when SourceText is provided. Omitting SourceText reads an
existing entry file while still emitting and loading the generated assembly
in memory.
module.Exports supports Get, Invoke, Value, and C# dynamic access.
Dispose the module when finished; it owns the execution runtime and
collectible load context. Keep it alive until any required async work settles.
No generated output files are written implicitly.
In-memory execution is not a sandbox. Only execute trusted scripts in the host process.
Artifact-only compilation
Use JrocInMemoryCompiler.Compile(request) when the application needs
JrocCompiledAssemblyArtifact.PeBytes and optional PdbBytes without
evaluating the script. Set EmitPdb on the request for debug symbols,
AssemblyName for a custom identity, and DiagnosticFilePath to capture
compiler diagnostics.
For JavaScript known at build time, prefer Jroc.SDK and generated typed
contracts rather than embedding compiler services in application code.
Links
- SDK docs: https://github.com/tomacox74/jroc/blob/master/docs/sdk/Index.md
- In-memory tutorial: https://github.com/tomacox74/jroc/blob/master/docs/sdk/tutorials/InMemoryCompileAndRun.md
- Source, issues, docs: https://github.com/tomacox74/jroc
- License: Apache-2.0
| Product | Versions 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. |
-
net10.0
- Acornima (>= 1.7.0)
- Jroc.Runtime (>= 0.12.26)
- Microsoft.Extensions.DependencyInjection (>= 10.0.1)
- Microsoft.Extensions.Logging (>= 10.0.1)
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 |
|---|---|---|
| 0.12.26 | 49 | 9/19/2026 |
| 0.12.25 | 51 | 9/18/2026 |
| 0.12.24 | 59 | 9/18/2026 |
| 0.12.23 | 85 | 9/16/2026 |
| 0.12.22 | 85 | 9/16/2026 |
| 0.12.21 | 110 | 9/9/2026 |
| 0.12.20 | 98 | 9/8/2026 |
| 0.12.19 | 111 | 9/8/2026 |
| 0.12.18 | 108 | 9/2/2026 |
| 0.12.17 | 92 | 9/2/2026 |
| 0.12.16 | 100 | 9/1/2026 |
| 0.12.15 | 109 | 8/30/2026 |
| 0.12.14 | 127 | 8/23/2026 |
| 0.12.13 | 116 | 8/21/2026 |
| 0.12.12 | 116 | 8/21/2026 |
| 0.12.11 | 118 | 8/19/2026 |
| 0.12.10 | 115 | 8/18/2026 |
| 0.12.9 | 121 | 8/18/2026 |
| 0.12.8 | 127 | 8/17/2026 |
| 0.12.7 | 128 | 8/16/2026 |