explaingit

chakra-core/chakracore

9,247JavaScriptAudience · developerComplexity · 4/5LicenseSetup · hard

TLDR

A JavaScript engine originally from Microsoft's Edge browser that you can embed in any C or C++ application via a C API, letting users write JavaScript scripts to control or extend your program, now community-maintained for embedded use cases.

Mindmap

mindmap
  root((ChakraCore))
    What it is
      JavaScript engine
      C API for embedding
      Former Edge engine
    Platform support
      Linux
      macOS
      Windows x64
      Windows ARM
    Use cases
      Embedded scripting
      Plugin systems
      Automation tools
    Status
      Community maintained
      MIT license
      Security patched
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

Embed a full JavaScript scripting engine into a C++ desktop application so users can automate or extend it with scripts

USE CASE 2

Compile ChakraCore on Linux or macOS and run JavaScript files with the included ch command-line tool

USE CASE 3

Use the C API to evaluate JavaScript expressions and pass results back into a host C application

USE CASE 4

Build a plugin system for a game engine or tool that accepts user-written JavaScript logic

Tech stack

CC++JavaScriptCMake

Getting it running

Difficulty · hard Time to first run · 1h+

Requires a C++ build toolchain and CMake, building on Windows also requires Visual Studio.

Free to use, modify, and distribute for any purpose including commercial use, keep the copyright notice.

In plain English

ChakraCore is a JavaScript engine, meaning it is the piece of software responsible for reading and running JavaScript code. It exposes a C programming interface, which makes it possible to embed a full JavaScript runtime inside any program written in C or C++. If you are building an application and want users to be able to write scripts in JavaScript to control or extend it, ChakraCore provides the machinery to do that. The engine was originally built by Microsoft and used inside the older Edge browser before Microsoft switched to a Chromium-based browser engine. At that point, Microsoft stopped using ChakraCore in Edge. Microsoft continued to issue security updates for version 1.11 until March 2021, but officially ended active development beyond that. The project has since continued as a community effort, with the focus shifted toward embedded use cases rather than browser environments. A JavaScript engine like this does not include the things a web browser or a runtime like Node.js adds on top, such as the ability to interact with web pages or the file system. ChakraCore is only the engine itself. When you embed it in your own application, you provide whatever input and output capabilities your program needs and call into ChakraCore to execute JavaScript logic. The engine can be compiled and run on Linux, macOS, and Windows for 64-bit processors. Building it on Windows additionally supports 32-bit and ARM processors. A small test application called ch is produced as part of the build and can be used to run simple JavaScript files directly from the terminal to confirm the engine is working. The project is open source under the MIT license. New contributors can help by reporting bugs, submitting fixes, or joining the community Discord server. Anyone interested in taking a more active role in the project's direction is invited to get in touch through the issue tracker or Discord.

Copy-paste prompts

Prompt 1
I want to embed ChakraCore in a C++ application so users can run JavaScript scripts. Show me the minimal C API calls to initialize the engine, evaluate a JS string, and retrieve the return value.
Prompt 2
How do I build ChakraCore from source on Linux using CMake, and then run the included ch binary to confirm a simple JavaScript file executes correctly?
Prompt 3
Using the ChakraCore C API, show me how to expose a custom C++ function so that JavaScript code running inside my application can call it with arguments.
Prompt 4
What is the difference between embedding ChakraCore and bundling Node.js, and when should I choose ChakraCore for an embedded scripting use case?
Open on GitHub → Explain another repo

← chakra-core on gitmyhub — every repo by this author, as a profile.

Verify against the repo before relying on details.