Jroc.Core 0.9.30

There is a newer version of this package available.
See the version list below for details.
dotnet add package Jroc.Core --version 0.9.30
                    
NuGet\Install-Package Jroc.Core -Version 0.9.30
                    
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="Jroc.Core" Version="0.9.30" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Jroc.Core" Version="0.9.30" />
                    
Directory.Packages.props
<PackageReference Include="Jroc.Core" />
                    
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 Jroc.Core --version 0.9.30
                    
#r "nuget: Jroc.Core, 0.9.30"
                    
#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 Jroc.Core@0.9.30
                    
#: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=Jroc.Core&version=0.9.30
                    
Install as a Cake Addin
#tool nuget:?package=Jroc.Core&version=0.9.30
                    
Install as a Cake Tool

Jroc.Core

Jroc.Core is the referenceable NuGet package for the reusable jroc compiler library.

It ships the Jroc.Compiler.dll assembly and compiler dependencies so custom .NET tools, build tasks, test harnesses, and hosts can compile JavaScript to .NET assemblies without shelling out to the jroc CLI tool.

The primary entry points are the existing Jroc.Compiler, Jroc.CompilerOptions, and Jroc.CompilerServices types in the Jroc namespace.

Which package should I use?

  • Jroc.Core
    • Use this when you want to embed the compiler directly in your own .NET code.
  • Jroc.SDK
    • Use this when your project should compile JavaScript during dotnet build.
  • jroc
    • Use this when you want the command-line tool for manual or ad-hoc compilation.
  • Jroc.Runtime
    • Use this when your host application needs the runtime support library used by generated assemblies.

Official releases publish Jroc.Runtime, jroc, Jroc.Core, and Jroc.SDK together at the same version. Keep the versions aligned when you mix them in one workflow.

Install

<ItemGroup>
  <PackageReference Include="Jroc.Core" Version="VERSION" />
</ItemGroup>

Basic usage

using Jroc;
using Microsoft.Extensions.DependencyInjection;

var options = new CompilerOptions
{
    OutputDirectory = @"C:\code\out",
    Verbose = true,
    EmitPdb = true
};

using var services = CompilerServices.BuildServiceProvider(options);
var compiler = services.GetRequiredService<Compiler>();

if (!compiler.Compile(@"C:\code\sample.js"))
{
    throw new InvalidOperationException("Compilation failed.");
}

Compiler.Compile(...) returns true on success and writes the generated files to CompilerOptions.OutputDirectory. If OutputDirectory is omitted, JROC writes next to the input file.

What gets generated?

Given an input like C:\code\sample.js, JROC emits the following into the output directory:

  • sample.dll
    • The compiled .NET assembly for your JavaScript.
  • sample.runtimeconfig.json
    • Runtime configuration for the dotnet host.
  • JavaScriptRuntime.dll (+ optional JavaScriptRuntime.pdb)
    • The runtime support library required to execute the generated assembly.

Useful options

  • OutputDirectory
    • Where generated files are written. If omitted, output is written next to the input file.
  • Verbose
    • Enables compiler progress logging.
  • DiagnosticFilePath
    • Writes compiler diagnostics to a text file.
  • AnalyzeUnused
    • Reports unused functions, properties, and variables.
  • StrictMode
    • Controls how missing "use strict" directive prologues are reported.
  • EmitPdb
    • Emits Portable PDB symbols next to the generated assembly, mapping both plain scripts and rewritten import / export modules back to the original source path for breakpoints and stack traces.
    • Uncaptured locals emit debugger local names; captured closure variables currently remain visible through generated scope types instead of ordinary local slots.
  • GenerateModuleExportContracts
    • Emits typed CommonJS export contracts for .NET hosting scenarios.
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 (1)

Showing the top 1 NuGet packages that depend on Jroc.Core:

Package Downloads
Jroc.SDK

MSBuild SDK package for compiling JavaScript sources into .NET assemblies during dotnet build.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.11.2 44 6/27/2026
0.11.1 46 6/27/2026
0.11.0 47 6/26/2026
0.10.1 103 6/23/2026
0.10.0 105 6/21/2026
0.9.32 103 6/20/2026
0.9.31 110 6/20/2026
0.9.30 107 6/19/2026
0.9.29 106 6/19/2026
0.9.28 102 6/17/2026