ChakraCore
ChakraCore is an open source Javascript engine with a C API.
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.
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.
Where it fits
- Embed a full JavaScript scripting engine into a C++ desktop application so users can automate or extend it with scripts
- Compile ChakraCore on Linux or macOS and run JavaScript files with the included ch command-line tool
- Use the C API to evaluate JavaScript expressions and pass results back into a host C application
- Build a plugin system for a game engine or tool that accepts user-written JavaScript logic