{"id":13432817,"url":"https://github.com/boa-dev/boa","last_synced_at":"2025-05-12T05:16:21.007Z","repository":{"id":36959057,"uuid":"144073539","full_name":"boa-dev/boa","owner":"boa-dev","description":"Boa is an embeddable and experimental Javascript engine written in Rust. Currently, it has support for some of the language.","archived":false,"fork":false,"pushed_at":"2025-05-11T16:34:13.000Z","size":51629,"stargazers_count":5591,"open_issues_count":134,"forks_count":428,"subscribers_count":49,"default_branch":"main","last_synced_at":"2025-05-12T02:43:17.783Z","etag":null,"topics":["ecmascript","hacktoberfest","interpreter","javascript","javascript-engine","javascript-interpreter","parser","runtime","rust","rust-crate","wasm","webassembly"],"latest_commit_sha":null,"homepage":"","language":"Rust","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/boa-dev.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE-MIT","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"open_collective":"boa"}},"created_at":"2018-08-08T22:20:05.000Z","updated_at":"2025-05-11T21:19:24.000Z","dependencies_parsed_at":"2023-09-24T13:06:41.126Z","dependency_job_id":"71cdc0ef-9e49-4256-80ca-fae44dca2bd5","html_url":"https://github.com/boa-dev/boa","commit_stats":{"total_commits":3022,"total_committers":190,"mean_commits":"15.905263157894737","dds":0.5866975512905361,"last_synced_commit":"0a5721bbc89d8b7e936c606cf09e8aaa4f56a6c0"},"previous_names":[],"tags_count":23,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/boa-dev%2Fboa","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/boa-dev%2Fboa/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/boa-dev%2Fboa/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/boa-dev%2Fboa/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/boa-dev","download_url":"https://codeload.github.com/boa-dev/boa/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253672675,"owners_count":21945479,"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":["ecmascript","hacktoberfest","interpreter","javascript","javascript-engine","javascript-interpreter","parser","runtime","rust","rust-crate","wasm","webassembly"],"created_at":"2024-07-31T02:01:17.031Z","updated_at":"2025-05-12T05:16:20.536Z","avatar_url":"https://github.com/boa-dev.png","language":"Rust","readme":"# Boa\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://boajs.dev/\"\u003e\n    \u003cpicture\u003e\n      \u003csource media=\"(prefers-color-scheme: dark)\" srcset=\"./assets/logo_yellow.svg\"\u003e\n      \u003csource media=\"(prefers-color-scheme: light)\" srcset=\"./assets/logo_black.svg\"\u003e\n      \u003cimg alt=\"Boa logo\" src=\"./assets/logo.png\"\u003e\n    \u003c/picture\u003e\n    \u003c/a\u003e\n\u003c/p\u003e\n\nThis is an experimental Javascript lexer, parser and interpreter written in Rust.\nCurrently, it has support for some of the language.\n\n[![Build Status][build_badge]][build_link]\n[![codecov](https://codecov.io/gh/boa-dev/boa/branch/main/graph/badge.svg)](https://codecov.io/gh/boa-dev/boa)\n[![Crates.io](https://img.shields.io/crates/v/boa_engine.svg)](https://crates.io/crates/boa_engine)\n[![Docs.rs](https://docs.rs/boa_engine/badge.svg)](https://docs.rs/boa_engine)\n[![Discord](https://img.shields.io/discord/595323158140158003?logo=discord)](https://discord.gg/tUFFk9Y)\n[![Matrix](https://img.shields.io/matrix/boa:matrix.org)](https://matrix.to/#/#boa:matrix.org)\n\n[build_badge]: https://github.com/boa-dev/boa/actions/workflows/rust.yml/badge.svg?event=push\u0026branch=main\n[build_link]: https://github.com/boa-dev/boa/actions/workflows/rust.yml?query=event%3Apush+branch%3Amain\n\n## Live Demo (WASM)\n\nTry out the engine now at the live WASM playground [here](https://boajs.dev/playground)!\n\nPrefer a CLI? Feel free to try out `boa_cli`!\n\n## Boa Crates\n\nBoa currently publishes and actively maintains the following crates:\n\n- **`boa_ast`** - Boa's ECMAScript Abstract Syntax Tree\n- **`boa_cli`** - Boa's CLI \u0026\u0026 REPL implementation\n- **`boa_engine`** - Boa's implementation of ECMAScript builtin objects and\n  execution\n- **`boa_gc`** - Boa's garbage collector\n- **`boa_interner`** - Boa's string interner\n- **`boa_parser`** - Boa's lexer and parser\n- **`boa_profiler`** - Boa's code profiler\n- **`boa_icu_provider`** - Boa's ICU4X data provider\n- **`boa_runtime`** - Boa's WebAPI features\n- **`boa_string`** - Boa's ECMAScript string implementation.\n\nPlease note: the `Boa` and `boa_unicode` crates are deprecated.\n\n## Boa Engine Example\n\nTo use `Boa` simply follow the below.\n\nAdd the below dependency to your `Cargo.toml`:\n\n```toml\n[dependencies]\nboa_engine = \"0.19.0\"\n```\n\nThen in `main.rs`, copy the below:\n\n```rust\nuse boa_engine::{Context, Source, JsResult};\n\nfn main() -\u003e JsResult\u003c()\u003e {\n  let js_code = r#\"\n      let two = 1 + 1;\n      let definitely_not_four = two + \"2\";\n\n      definitely_not_four\n  \"#;\n\n  // Instantiate the execution context\n  let mut context = Context::default();\n\n  // Parse the source code\n  let result = context.eval(Source::from_bytes(js_code))?;\n\n  println!(\"{}\", result.display());\n\n  Ok(())\n}\n\n```\n\nNow, all that's left to do is `cargo run`.\n\nCongrats! You've executed your first `JavaScript` using `Boa`!\n\n## Documentation\n\nFor more information on `Boa`'s API. Feel free to check out our documentation.\n\n[**API Documentation**](https://docs.rs/boa_engine/latest/boa_engine/)\n\n## Conformance\n\nTo know how much of the _ECMAScript_ specification does Boa cover, you can check out results\nrunning the _ECMASCript Test262_ test suite [here](https://boajs.dev/conformance).\n\n## Contributing\n\nPlease, check the [CONTRIBUTING.md](CONTRIBUTING.md) file to know how to\ncontribute in the project. You will need Rust installed and an editor. We have\nsome configurations ready for VSCode.\n\n### Debugging\n\nCheck [debugging.md](./docs/debugging.md) for more info on debugging.\n\n### Web Assembly\n\nThis interpreter can be exposed to JavaScript!\nYou can build the example locally with:\n\n```shell\nnpm run build\n```\n\nIn the console you can use `window.evaluate` to pass JavaScript in.\nTo develop on the web assembly side you can run:\n\n```shell\nnpm run serve\n```\n\nthen go to `http://localhost:8080`.\n\n## Usage\n\n- Clone this repo.\n- Run with `cargo run -- test.js` in the project root directory where `test.js` is a path to an existing JS file with any valid JS code.\n- If any JS doesn't work then it's a bug. Please raise an [issue](https://github.com/boa-dev/boa/issues/)!\n\n### Example\n\n![Example](docs/img/latestDemo.gif)\n\n## Command-line Options\n\n```txt\nUsage: boa [OPTIONS] [FILE]...\n\nArguments:\n  [FILE]...  The JavaScript file(s) to be evaluated\n\nOptions:\n      --strict                        Run in strict mode\n  -a, --dump-ast [\u003cFORMAT\u003e]           Dump the AST to stdout with the given format [possible values: debug, json, json-pretty]\n  -t, --trace                         Dump the AST to stdout with the given format\n      --vi                            Use vi mode in the REPL\n  -O, --optimize\n      --optimizer-statistics\n      --flowgraph [\u003cFORMAT\u003e]          Generate instruction flowgraph. Default is Graphviz [possible values: graphviz, mermaid]\n      --flowgraph-direction \u003cFORMAT\u003e  Specifies the direction of the flowgraph. Default is top-top-bottom [possible values: top-to-bottom, bottom-to-top, left-to-right, right-to-left]\n      --debug-object                  Inject debugging object `$boa`\n  -m, --module                        Treats the input files as modules\n  -r, --root \u003cROOT\u003e                   Root path from where the module resolver will try to load the modules [default: .]\n  -h, --help                          Print help (see more with '--help')\n  -V, --version                       Print version\n```\n\n## Roadmap\n\nSee [Milestones](https://github.com/boa-dev/boa/milestones).\n\n## Benchmarks\n\nSee [Benchmarks](https://boajs.dev/benchmarks).\n\n## Profiling\n\nSee [Profiling](./docs/profiling.md).\n\n## Changelog\n\nSee [CHANGELOG.md](./CHANGELOG.md).\n\n## Communication\n\nFeel free to contact us on [Matrix](https://matrix.to/#/#boa:matrix.org) if you have any questions.\nContributor discussions take place on the same Matrix Space if you're interested in contributing.\nWe also have a [Discord](https://discord.gg/tUFFk9Y) for any questions or issues.\n\n## License\n\nThis project is licensed under the [Unlicense](./LICENSE-UNLICENSE) or [MIT](./LICENSE-MIT) licenses, at your option.\n","funding_links":["https://opencollective.com/boa"],"categories":["Rust","JavaScript框架","Engines","打包工具","languages","Libraries","webassembly"],"sub_categories":["其他_文本生成、文本对话","非 JavaScript 编译工具","javascript","Scripting"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fboa-dev%2Fboa","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fboa-dev%2Fboa","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fboa-dev%2Fboa/lists"}