{"id":13719596,"url":"https://github.com/theduke/quickjs-rs","last_synced_at":"2025-05-15T11:08:02.436Z","repository":{"id":37484153,"uuid":"197148929","full_name":"theduke/quickjs-rs","owner":"theduke","description":"Rust wrapper for the quickjs Javascript engine.","archived":false,"fork":false,"pushed_at":"2023-07-31T17:27:37.000Z","size":1286,"stargazers_count":600,"open_issues_count":34,"forks_count":48,"subscribers_count":11,"default_branch":"master","last_synced_at":"2025-05-14T20:50:16.290Z","etag":null,"topics":["javascript","javascript-engine","rust","rust-lang"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/theduke.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2019-07-16T08:03:56.000Z","updated_at":"2025-04-28T01:40:49.000Z","dependencies_parsed_at":"2024-02-03T08:44:39.635Z","dependency_job_id":"a9caa0ca-afa6-4725-b229-e42ab794f5a4","html_url":"https://github.com/theduke/quickjs-rs","commit_stats":{"total_commits":180,"total_committers":11,"mean_commits":"16.363636363636363","dds":"0.21111111111111114","last_synced_commit":"941b3610e7d8e95de99369c9935a79fbbab0a7d3"},"previous_names":[],"tags_count":21,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/theduke%2Fquickjs-rs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/theduke%2Fquickjs-rs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/theduke%2Fquickjs-rs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/theduke%2Fquickjs-rs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/theduke","download_url":"https://codeload.github.com/theduke/quickjs-rs/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254328384,"owners_count":22052632,"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":["javascript","javascript-engine","rust","rust-lang"],"created_at":"2024-08-03T01:00:52.472Z","updated_at":"2025-05-15T11:08:02.416Z","avatar_url":"https://github.com/theduke.png","language":"C","readme":"# quickjs-rs\n\n[![Crates.io](https://img.shields.io/crates/v/quick-js.svg?maxAge=3600)](https://crates.io/crates/quick-js)\n[![docs.rs](https://docs.rs/quick-js/badge.svg)](https://docs.rs/quick-js)\n[![Build Status](https://github.com/theduke/quickjs-rs/workflows/CI/badge.svg)\n\nA Rust wrapper for [QuickJS](https://bellard.org/quickjs/). \n\nQuickJS is a new, small Javascript engine by Fabrice Bellard and Charlie Gordon. \nIt is fast and supports the full ES2020 specification.\n\nThis crate allows you to easily run and integrate with Javascript code from Rust.\n\n## Quickstart\n\n```toml\n[dependencies]\nquick-js = \"0.4.1\"\n```\n\n```rust\nuse quick_js::{Context, JsValue};\n\nlet context = Context::new().unwrap();\n\n// Eval.\n\nlet value = context.eval(\"1 + 2\").unwrap();\nassert_eq!(value, JsValue::Int(3));\n\nlet value = context.eval_as::\u003cString\u003e(\" var x = 100 + 250; x.toString() \").unwrap();\nassert_eq!(\u0026value, \"350\");\n\n// Callbacks.\n\ncontext.add_callback(\"myCallback\", |a: i32, b: i32| a + b).unwrap();\n\ncontext.eval(r#\"\n    // x will equal 30\n    var x = myCallback(10, 20);\n\"#).unwrap();\n```\n\n## Optional Features\n\nThe crate supports the following features:\n\n* `chrono`: chrono integration\n    - adds a `JsValue::Date` variant that can be (de)serialized to/from a JS `Date`\n* `bigint`: arbitrary precision integer support via [num-bigint](https://github.com/rust-num/num-bigint)\n* `log`: allows forwarding `console.log` messages to the `log` crate.\n    Note: must be enabled with `ContextBuilder::console(quick_js::console::LogConsole);`\n\n* `patched` \n    Enabled automatically for some other features, like `bigint`. \n    You should not need to enable this manually.\n    Applies QuickJS patches that can be found in `libquickjs-sys/embed/patches` directory.\n\n\n## Installation\n\nBy default, quickjs is **bundled** with the `libquickjs-sys` crate and\nautomatically compiled, assuming you have the appropriate dependencies.\n\n### Windows Support\n\nWindows is only supported with the [MSYS2](https://www.msys2.org/) environment \nand `x86_64-pc-windows-gnu` target architecture. \n\nIf you have MSYS2 installed and the MSYS `bin` directory in your path, you can\ncompile quickjs with `cargo build --target=\"x86_64-pc-windows-gnu\"`. \n\nThe target can also be configured permanently via a \n[cargo config file](https://doc.rust-lang.org/cargo/reference/config.html) or \nthe `CARGO_BUILD_TARGET` env var.\n\n### System installation\n\nTo use the system installation, without the bundled feature, first install the required \ndependencies, and then compile and install quickjs.\n\n```bash\n# Debian/Ubuntu: apt-get install -y curl xz-utils build-essential gcc-multilib libclang-dev clang\nmkdir quickjs \ncurl -L https://bellard.org/quickjs/quickjs-2019-07-09.tar.xz | tar xJv -C quickjs --strip-components 1\ncd quickjs\nsudo make install\n```\n\nYou then need to disable the `bundled` feature in the `libquickjs-sys` crate to\nforce using the system version.\n","funding_links":[],"categories":["C"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftheduke%2Fquickjs-rs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftheduke%2Fquickjs-rs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftheduke%2Fquickjs-rs/lists"}