jroc 0.12.23
dotnet tool install --global jroc --version 0.12.23
dotnet new tool-manifest
dotnet tool install --local jroc --version 0.12.23
#tool dotnet:?package=jroc&version=0.12.23
nuke :add-package jroc --version 0.12.23
jroc – JavaScript .NET compiler (consumer guide)
jroc is a JavaScript to .NET compiler, available as a .NET global tool. It compiles JavaScript source code to native .NET assemblies you can run on .NET.
Install
- Prerequisite: .NET 10 SDK or later installed.
- Install the tool globally:
dotnet tool install --global jroc
Update later:
dotnet tool update --global jroc
Uninstall:
dotnet tool uninstall --global jroc
Which package should I use?
jroc- The global CLI tool for ad-hoc/manual JavaScript compilation from a terminal.
Jroc.SDK- The MSBuild/NuGet integration for host projects that should compile JavaScript during
dotnet build.
- The MSBuild/NuGet integration for host projects that should compile JavaScript during
Jroc.Core- In-memory compilation for scripts not known until runtime.
Jroc.Runtime- Execution support for generated assemblies and in-memory modules;
Jroc.SDKsupplies it transitively to MSBuild consumers.
- Execution support for generated assemblies and in-memory modules;
Official releases publish Jroc.Runtime, jroc, Jroc.Core, and Jroc.SDK together at the same version. When you mix these packages in one workflow, keep the versions aligned.
Usage
jroc <InputFile> [<OutputPath>] [options]
Options
- -i, --input The JavaScript file to convert (positional supported)
- -o, --output Output folder for the generated IL/assembly (created if missing; defaults to the input file directory)
- -v, --verbose Print compiler diagnostics to the console
- --diagnostic-file <path> Write compiler diagnostics to a text file
- -a, --analyzeunused Report unused functions/properties/variables --version Show version information and exit
Help: -h, --help, -?
Example:
# Convert tests\simple.js and write output next to the file
jroc .\tests\simple.js
# Convert to a specific directory with verbose output
jroc .\tests\simple.js -o .\out -v
What gets generated?
Given an input like C:\code\sample.js, jroc will emit the following into the output directory (default: alongside the input file):
sample.dll- A .NET assembly (targeting net10.0) containing IL corresponding to your JavaScript.
- The assembly name is the input file name without extension.
- Contains a
Program.Mainentry point that executes your script when run.
sample.runtimeconfig.json- Runtime configuration for the
dotnethost (framework: .NET 10).
- Runtime configuration for the
JavaScriptRuntime.dll(+ optionalJavaScriptRuntime.pdbif available)- Required runtime support library that provides JS primitives (e.g.,
console.log, arrays, objects) used by the emitted IL. - This file is copied next to your generated assembly and must be present at runtime.
- Required runtime support library that provides JS primitives (e.g.,
Run it with:
dotnet .\sample.dll
Notes:
- Console output (e.g.,
console.log) is implemented via the bundledJavaScriptRuntime.dll. - This is a prototype and doesn’t yet support all JavaScript features. See the repo docs for supported syntax and feature coverage.
- Errors are written to stderr and known failures return a non-zero exit code.
Limitations
- Target framework: net10.0
- Not all JS features are supported; some constructs may be validated and rejected with explanations.
- Emitted IL and runtime surface are subject to change between previews.
Troubleshooting
- Ensure the .NET 10 SDK/runtime is on PATH:
dotnet --info - Use
-vto print diagnostics to the console, or--diagnostic-file <path>to capture diagnostics to a file. - File an issue with a minimal JS sample if you suspect a bug.
Hosting samples
The jroc tool package no longer carries the hosted C# samples. Those samples now ship with Jroc.SDK, because they are intended to validate the MSBuild/NuGet integration path that hosting consumers use in real projects.
See:
- the repo
samples\directory Jroc.SDKpackage page:https://www.nuget.org/packages/Jroc.SDKJroc.Corepackage page:https://www.nuget.org/packages/Jroc.Core
Links
- SDK (.NET library mode): https://github.com/tomacox74/jroc/blob/master/docs/sdk/Index.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. |
This package has no dependencies.
| Version | Downloads | Last Updated |
|---|---|---|
| 0.12.23 | 46 | 9/16/2026 |
| 0.12.22 | 47 | 9/16/2026 |
| 0.12.21 | 116 | 9/9/2026 |
| 0.12.20 | 100 | 9/8/2026 |
| 0.12.19 | 108 | 9/8/2026 |
| 0.12.18 | 103 | 9/2/2026 |
| 0.12.17 | 91 | 9/2/2026 |
| 0.12.16 | 102 | 9/1/2026 |
| 0.12.15 | 111 | 8/30/2026 |
| 0.12.14 | 119 | 8/23/2026 |
| 0.12.13 | 114 | 8/21/2026 |
| 0.12.12 | 115 | 8/21/2026 |
| 0.12.11 | 157 | 8/19/2026 |
| 0.12.10 | 108 | 8/18/2026 |
| 0.12.9 | 122 | 8/18/2026 |
| 0.12.8 | 123 | 8/17/2026 |
| 0.12.7 | 122 | 8/16/2026 |
| 0.12.4 | 109 | 8/6/2026 |
| 0.12.3 | 112 | 8/5/2026 |
| 0.12.2 | 109 | 8/5/2026 |