#javascript-engine #spider-monkey #bindings #mozilla #memory-safety #servo

mozjs

Rust bindings to the Mozilla SpiderMonkey JavaScript engine

29 releases

new 0.14.3 Dec 18, 2025
0.10.1 Mar 25, 2019
0.9.5 Nov 15, 2018
0.7.1 May 30, 2018
0.1.8 Nov 10, 2017

#165 in Memory management

Download history 20/week @ 2025-08-27 43/week @ 2025-09-03 59/week @ 2025-09-10 19/week @ 2025-09-17 49/week @ 2025-09-24 49/week @ 2025-10-01 10/week @ 2025-10-08 36/week @ 2025-10-15 26/week @ 2025-10-22 15/week @ 2025-10-29 3/week @ 2025-11-05 10/week @ 2025-11-19 929/week @ 2025-11-26 4025/week @ 2025-12-03 3820/week @ 2025-12-10

8,784 downloads per month
Used in 3 crates

MPL-2.0 license

87MB
1.5M SLoC

C++ 1M SLoC // 0.1% comments Python 574K SLoC // 0.2% comments C 113K SLoC // 0.1% comments Bitbake 37K SLoC // 0.0% comments JavaScript 17K SLoC // 0.3% comments Rust 7K SLoC // 0.0% comments Visual Studio Project 2.5K SLoC // 0.0% comments Cython 2K SLoC // 0.1% comments Bazel 1K SLoC // 0.0% comments GNU Style Assembly 1K SLoC // 0.2% comments Perl 875 SLoC // 0.3% comments M4 712 SLoC // 0.2% comments Visual Studio Solution 709 SLoC Shell 683 SLoC // 0.3% comments Batch 503 SLoC // 0.0% comments Forge Config 304 SLoC // 0.9% comments Korn shell 224 SLoC // 0.3% comments Java 191 SLoC // 0.2% comments VB6/VBA 149 SLoC Templ 84 SLoC RPM Specfile 37 SLoC INI 25 SLoC // 0.2% comments D 7 SLoC // 0.8% comments

This crate contains Rust bindings to the SpiderMonkey Javascript engine developed by Mozilla.

These bindings are designed to be a fairly straightforward translation to the C++ API, while taking advantage of Rust's memory safety. For more about the Spidermonkey API, see the embedding examples on GitHub.

The code from User Guide sections A minimal example and Running scripts are also included.


mozjs

Rust bindings to SpiderMonkey

Documentation

See https://github.com/servo/mozjs/blob/main/README.md for build instructions.

Dependencies

~4–13MB
~242K SLoC