A minimal embedded JavaScript engine for microcontrollers with seamless C/C++ interoperability.
mJS is an embedded JavaScript engine designed for microcontrollers and resource-constrained systems. It provides a minimal ES6-compatible scripting environment with direct C/C++ interoperability, allowing developers to add JavaScript scripting to IoT devices without heavy runtime overhead.
Embedded systems developers and IoT engineers who need to add scripting capabilities to microcontrollers with limited flash and RAM.
Developers choose mJS for its extremely small footprint, seamless C/C++ integration via FFI, and focus on practical embedded use cases over full JavaScript compliance.
Embedded JavaScript engine for C/C++
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Consumes only about 50KB of flash and under 1KB of RAM on 32-bit ARM, enabling JavaScript scripting on severely constrained microcontrollers where other engines are impractical.
Foreign Function Interface allows calling C functions with no glue code, supporting up to 6 arguments for seamless integration with existing embedded libraries.
Strings are byte strings capable of representing arbitrary binary data, ideal for low-level device communication and handling raw data chunks in IoT applications.
Provides s2o function to convert C structs to JavaScript objects using descriptors, simplifying data exchange between C and JS layers in embedded systems.
Implements only a strict subset of ES6, missing closures, exceptions, standard library objects, and modern syntax like arrow functions, which limits code portability and developer familiarity.
FFI supports only basic data types (int, double, char*); for functions with structures or complex arguments, developers must write C wrappers, adding overhead and complexity.
Released under GPLv2, which may force commercial projects to open-source their code or purchase a commercial license, creating legal and cost barriers for proprietary deployments.