{"id":21235742,"url":"https://github.com/darfink/chakracore-rs","last_synced_at":"2025-07-10T17:31:47.407Z","repository":{"id":57547389,"uuid":"74291343","full_name":"darfink/chakracore-rs","owner":"darfink","description":"An idiomatic Rust wrapper for the JSRT interface","archived":false,"fork":false,"pushed_at":"2022-03-28T10:10:34.000Z","size":3061,"stargazers_count":39,"open_issues_count":13,"forks_count":10,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-06-06T22:38:09.961Z","etag":null,"topics":["chakracore","javascript","rust"],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/darfink.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-11-20T17:36:19.000Z","updated_at":"2022-03-28T10:10:37.000Z","dependencies_parsed_at":"2022-09-26T16:30:42.089Z","dependency_job_id":null,"html_url":"https://github.com/darfink/chakracore-rs","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/darfink/chakracore-rs","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/darfink%2Fchakracore-rs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/darfink%2Fchakracore-rs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/darfink%2Fchakracore-rs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/darfink%2Fchakracore-rs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/darfink","download_url":"https://codeload.github.com/darfink/chakracore-rs/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/darfink%2Fchakracore-rs/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264619103,"owners_count":23638406,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["chakracore","javascript","rust"],"created_at":"2024-11-21T00:02:54.390Z","updated_at":"2025-07-10T17:31:46.928Z","avatar_url":"https://github.com/darfink.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"## NOTE: This project is not currently maintained, due to ChakraCore itself is no longer being actively developed.\n\n\u003cdiv align=\"center\"\u003e\n\n# `chakracore-rs`\n\n[![crates.io version][crate-shield]][crate]\n[![Documentation][docs-shield]][docs]\n[![Language (Rust)][rust-shield]][rust]\n\n\u003c/div\u003e\n\n**chakracore-rs is an iditiomatic wrapper for\n[ChakraCore](https://github.com/Microsoft/ChakraCore), written in Rust.**\n\nThis repository contains two crates:\n- [chakracore-sys](#chakracore-sys) - raw bindings to the JavaScript\nRuntime.\n- [chakracore](#chakracore) - an idiomatic wrapper, built on the\nchakracore-sys crate.\n\n## chakracore\n\nThis is a wrapper around the [JavaScript Runtime (JSRT)](https://goo.gl/1F6Gi1),\nused in [Microsoft Edge](https://www.microsoft.com/en-us/windows/microsoft-edge)\nand [node-chakracore](https://github.com/nodejs/node-chakracore). The library is\nstill in pre-release and is not yet stable. The tests try to cover as much\nfunctionality as possible but memory leaks and segfaults may occur. If you want\na more stable library, use the underlying API directly;\n[chakracore-sys](#chakracore-sys).\n\n### Installation\n\nAdd this to your `Cargo.toml`:\n\n```toml\n[dependencies]\nchakracore = \"0.2\"\n```\n\n... and this to your crate root:\n\n```rust\nextern crate chakracore as js;\n```\n\n*NOTE: See additional build instructions for [chakracore-sys](#chakracore-sys)*\n\n### Examples\n\n#### Hello World\n\n```rust\nextern crate chakracore as js;\n\nfn main() {\n  let runtime = js::Runtime::new().unwrap();\n  let context = js::Context::new(\u0026runtime).unwrap();\n  let guard = context.make_current().unwrap();\n\n  let result = js::script::eval(\u0026guard, \"5 + 5\").unwrap();\n  assert_eq!(result.to_integer(\u0026guard), 10);\n}\n```\n\n#### Function - Multiply\n\n```rust\nextern crate chakracore as js;\n\nfn main() {\n  let runtime = js::Runtime::new().unwrap();\n  let context = js::Context::new(\u0026runtime).unwrap();\n  let guard = context.make_current().unwrap();\n\n  let multiply = js::value::Function::new(\u0026guard, Box::new(|guard, info| {\n      let result = info.arguments[0].to_integer(guard)\n                 * info.arguments[1].to_integer(guard);\n      Ok(js::value::Number::new(guard, result).into())\n  }));\n\n  let result = multiply.call(\u0026guard, \u0026[\n      \u0026js::value::Number::new(\u0026guard, 191).into(),\n      \u0026js::value::Number::new(\u0026guard, 7).into(),\n  ]).unwrap();\n\n  assert_eq!(result.to_integer(\u0026guard), 1337);\n}\n```\n\n## chakracore-sys\n\nThis library handles the static and dynamic linking of the JavaScript\nRuntime. The rust bindings are generated (on the fly) for the interface,\ntherefore the entire API is exposed and accessable.\n\nA *Hello World* example can be found in\n[src/lib.rs](./chakracore-sys/src/lib.rs).\n\nAn example of the generated bindings can be found\n[here](https://gist.github.com/darfink/d519756ad88efcddfbfe895439cf9451).\n\n### Requirements\n\nThis library builds the ChakraCore component in the source tree. It is cloned\nby the build script and built in test-mode (same as release, but includes\nmore runtime checks). If custom build settings are desired, ChakraCore can be\nbuilt manually, out of tree, and specified using two environment variables:\n\n* `CHAKRA_SOURCE`: The root of the ChakraCore checkout.\n* `CHAKRA_BUILD`: The `bin` directory of the build.\n  - Default on Windows: `%CHAKRA_SOURCE%\\Build\\VcBuild\\bin\\{BUILD_TYPE}`.\n  - Default on Unix: `$CHAKRA_SOURCE/BuildLinux/{BUILD_TYPE}`.\n\nThis script has not been tested with the `--embed-icu` option.\n\n#### Static/Shared\n\nBy default, this library links ChakraCore dynamically. There is a feature\ncalled `static` that builds it by linking to the generated archive instead.\nOn windows, only shared library builds are available as of this time (see\n[#279](https://github.com/Microsoft/ChakraCore/issues/279)).\n\n#### Prerequisites\n\nThe library naturally shares all of ChakraCore's dependencies. Beyond this,\n[rust-bindgen](https://github.com/servo/rust-bindgen) is used in the build\nscript, which requires `clang-3.8` or later. On Unix `pkg-config` is required as\nwell.\n\n##### Windows\n\n* Visual Studio 2013/2015/2017 with:\n  - Windows SDK 8.1\n  - C++ support\n* `clang-3.8` or later. Downloads can be found\n  [here](http://llvm.org/releases/download.html).  \n  Remember to add LLVM directories to `PATH` during installation.\n* Rust MSVC toolchain (i.e `rustup install stable-msvc`).  \n  This is required since ChakraCore uses the MSVC ABI.\n* If building for ARM: [Windows 10 SDK (July\n  2015)](https://developer.microsoft.com/en-us/windows/downloads/sdk-archive)\n\n##### macOS\n\n```\n$ brew install cmake icu4c llvm38 pkg-config\n```\n\n##### Debian-based linuxes\n\n```\n# apt-get install -y build-essential cmake clang libunwind8-dev \\\n#     libicu-dev llvm-3.8-dev libclang-3.8-dev pkg-config liblzma-dev\n```\n\n#### Building\n\n- ##### Windows\n\n  Ensure that you are running in a Visual Studio command line environment,\n  either by sourcing `vcvarsall.bat`, or by building from the Visual\n  Studio Command Prompt.\n\n  ```\n  $ cargo test -vv\n  ```\n\n- ##### Unix\n\n  ```\n  $ cargo test -vv [--features static]\n  ```\n\nIn case you find yourself stuck in the build process, open an\n[issue](https://github.com/darfink/chakracore-rs/issues/new).\n\n#### Status\n\nThis library has been built on `macOS 10.12 x86_64`, `Ubuntu 16.10 x86_64` and\n`Windows 10 x86_x64`.\n\u003c!-- Links --\u003e\n[crate-shield]: https://img.shields.io/crates/v/chakracore.svg?style=flat-square\n[crate]: https://crates.io/crates/chakracore\n[rust-shield]: https://img.shields.io/badge/powered%20by-rust-blue.svg?style=flat-square\n[rust]: https://www.rust-lang.org\n[docs-shield]: https://img.shields.io/badge/docs-crates-green.svg?style=flat-square\n[docs]: https://darfink.github.io/chakracore-rs/chakracore/index.html\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdarfink%2Fchakracore-rs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdarfink%2Fchakracore-rs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdarfink%2Fchakracore-rs/lists"}