explaingit

sebastienros/jint

4,624C#Audience · developerComplexity · 2/5Setup · easy

TLDR

A JavaScript interpreter you add to a .NET app as a NuGet package, letting you run JavaScript code inside C# without Node.js or a browser, ideal for sandboxed user scripting or exposing .NET objects to JavaScript.

Mindmap

mindmap
  root((jint))
    What it is
      JS interpreter for .NET
      NuGet package
      No Node.js needed
    Main use cases
      Sandboxed scripting
      .NET to JS bridge
      User customization
    JS standards supported
      ES6 through ES2025
      async and await
      Modules and classes
    Used by
      RavenDB
      OrchardCore
      ELSA Workflows
    Performance notes
      No .NET bytecode compile
      Cache prepared scripts
      Not thread safe
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Things people build with this

USE CASE 1

Let end users write JavaScript scripts that customize your .NET application behavior without requiring a recompile

USE CASE 2

Run untrusted JavaScript in a controlled sandbox where file system access and network calls are blocked

USE CASE 3

Pass a C# object into a script and read back the modified properties or return value as a .NET type

USE CASE 4

Add a scripting engine to a workflow or rule system so non-developers can write logic in JavaScript

Tech stack

C#.NETNuGetJavaScript

Getting it running

Difficulty · easy Time to first run · 5min

Install the Jint NuGet package, no external runtime or native dependencies required.

License not described in the explanation.

In plain English

Jint is a JavaScript interpreter written in C# that runs inside .NET applications. Rather than installing a separate JavaScript runtime, you can add Jint as a NuGet package and execute JavaScript code directly from within your .NET program, without any browser or Node.js involved. The main use cases are: running JavaScript in a controlled sandbox where you limit what the code can do (for example, preventing file system access or network calls), exposing .NET objects and functions to JavaScript code (so your script can call a .NET method, access a database result, or manipulate a C# object), and adding scripting support to applications so that end users can customize behavior using JavaScript without recompiling anything. Real-world users of the library include RavenDB (a document database), EventStore, OrchardCore, and ELSA Workflows. The code examples in the README show how this works in practice. You can set a .NET method as a JavaScript function, run a script that calls it, pass a C# object into JavaScript and have the script modify its properties, or call a JavaScript function by name from C# and get the result back as a .NET value. Jint supports a wide range of modern JavaScript standards, from ECMAScript 2015 (ES6) through ECMAScript 2025, including async/await, modules, classes, BigInt, optional chaining, and many active proposals not yet in a final spec. The one notable gap is tail call optimization. Performance is reasonable for small scripts because the interpreter does not compile to .NET bytecode. If you run the same script repeatedly, caching a prepared script object avoids re-parsing it each time. Engine instances are not thread-safe and should not be shared across threads.

Copy-paste prompts

Prompt 1
Using Jint in a C# console app, show me how to expose a .NET method called FetchUserById to JavaScript, run a script that calls it, and return the result back to C#.
Prompt 2
I want to let users of my .NET app submit custom JavaScript formulas that transform data. Using Jint, show me how to run those scripts safely, block any access to the file system, and cap execution time with a timeout.
Prompt 3
Using Jint, write a C# helper that accepts a JavaScript function string, passes in a data object as a parameter, and returns the computed result as a .NET Dictionary.
Prompt 4
My app runs the same Jint script thousands of times per request. Show me how to pre-parse and cache the script object so I avoid re-parsing on every execution.
Open on GitHub → Explain another repo

← sebastienros on gitmyhub — every repo by this author, as a profile.

Verify against the repo before relying on details.