{"id":13432790,"url":"https://github.com/rustwasm/wasm-bindgen","last_synced_at":"2025-05-12T16:17:18.647Z","repository":{"id":37502436,"uuid":"114685405","full_name":"rustwasm/wasm-bindgen","owner":"rustwasm","description":"Facilitating high-level interactions between Wasm modules and JavaScript","archived":false,"fork":false,"pushed_at":"2025-04-24T02:40:59.000Z","size":23915,"stargazers_count":8208,"open_issues_count":521,"forks_count":1108,"subscribers_count":99,"default_branch":"main","last_synced_at":"2025-05-04T22:14:23.387Z","etag":null,"topics":["binding-generator","javascript","rust","rust-wasm","wasm"],"latest_commit_sha":null,"homepage":"https://rustwasm.github.io/docs/wasm-bindgen/","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rustwasm.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yaml","license":"LICENSE-APACHE","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,"publiccode":null,"codemeta":null,"zenodo":null},"funding":{"github":["daxpedda"]}},"created_at":"2017-12-18T20:38:44.000Z","updated_at":"2025-05-04T00:39:08.000Z","dependencies_parsed_at":"2024-02-08T11:28:20.117Z","dependency_job_id":"91e9f521-cba0-424d-b034-54aaebcd714f","html_url":"https://github.com/rustwasm/wasm-bindgen","commit_stats":{"total_commits":3126,"total_committers":476,"mean_commits":6.567226890756302,"dds":0.661868202175304,"last_synced_commit":"e250852b220d1ecb0a4b23b3e04d0a2d8c7304bf"},"previous_names":[],"tags_count":109,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rustwasm%2Fwasm-bindgen","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rustwasm%2Fwasm-bindgen/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rustwasm%2Fwasm-bindgen/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rustwasm%2Fwasm-bindgen/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rustwasm","download_url":"https://codeload.github.com/rustwasm/wasm-bindgen/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252416510,"owners_count":21744448,"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":["binding-generator","javascript","rust","rust-wasm","wasm"],"created_at":"2024-07-31T02:01:16.600Z","updated_at":"2025-05-05T12:50:04.640Z","avatar_url":"https://github.com/rustwasm.png","language":"Rust","readme":"\u003cdiv align=\"center\"\u003e\n\n  \u003ch1\u003e\u003ccode\u003ewasm-bindgen\u003c/code\u003e\u003c/h1\u003e\n\n  \u003cp\u003e\n    \u003cstrong\u003eFacilitating high-level interactions between Wasm modules and JavaScript.\u003c/strong\u003e\n  \u003c/p\u003e\n\n  \u003cp\u003e\n    \u003ca href=\"https://github.com/rustwasm/wasm-bindgen/actions/workflows/main.yml?query=branch%3Amain\"\u003e\u003cimg src=\"https://github.com/rustwasm/wasm-bindgen/actions/workflows/main.yml/badge.svg?branch=main\" alt=\"Build Status\" /\u003e\u003c/a\u003e\n    \u003ca href=\"https://crates.io/crates/wasm-bindgen\"\u003e\u003cimg src=\"https://img.shields.io/crates/v/wasm-bindgen.svg?style=flat-square\" alt=\"Crates.io version\" /\u003e\u003c/a\u003e\n    \u003ca href=\"https://crates.io/crates/wasm-bindgen\"\u003e\u003cimg src=\"https://img.shields.io/crates/d/wasm-bindgen.svg?style=flat-square\" alt=\"Download\" /\u003e\u003c/a\u003e\n    \u003ca href=\"https://docs.rs/wasm-bindgen\"\u003e\u003cimg src=\"https://img.shields.io/badge/docs-latest-blue.svg?style=flat-square\" alt=\"docs.rs docs\" /\u003e\u003c/a\u003e\n  \u003c/p\u003e\n\n  \u003ch3\u003e\n    \u003ca href=\"https://rustwasm.github.io/wasm-bindgen/\"\u003eGuide (main branch)\u003c/a\u003e\n    \u003cspan\u003e | \u003c/span\u003e\n    \u003ca href=\"https://docs.rs/wasm-bindgen\"\u003eAPI Docs\u003c/a\u003e\n    \u003cspan\u003e | \u003c/span\u003e\n    \u003ca href=\"https://github.com/rustwasm/wasm-bindgen/blob/master/CONTRIBUTING.md\"\u003eContributing\u003c/a\u003e\n    \u003cspan\u003e | \u003c/span\u003e\n    \u003ca href=\"https://discord.gg/xMZ7CCY\"\u003eChat\u003c/a\u003e\n  \u003c/h3\u003e\n\n  \u003csub\u003eBuilt with 🦀🕸 by \u003ca href=\"https://rustwasm.github.io/\"\u003eThe Rust and WebAssembly Working Group\u003c/a\u003e\u003c/sub\u003e\n\u003c/div\u003e\n\n## Install `wasm-bindgen-cli`\n\nYou can install it using `cargo install`:\n\n```\ncargo install wasm-bindgen-cli\n```\n\nOr, you can download it from the\n[release page](https://github.com/rustwasm/wasm-bindgen/releases).\n\nIf you have [`cargo-binstall`](https://crates.io/crates/cargo-binstall) installed,\nthen you can install the pre-built artifacts by running:\n\n```\ncargo binstall wasm-bindgen-cli\n```\n\n## Example\n\nImport JavaScript things into Rust and export Rust things to JavaScript.\n\n```rust\nuse wasm_bindgen::prelude::*;\n\n// Import the `window.alert` function from the Web.\n#[wasm_bindgen]\nextern \"C\" {\n    fn alert(s: \u0026str);\n}\n\n// Export a `greet` function from Rust to JavaScript, that alerts a\n// hello message.\n#[wasm_bindgen]\npub fn greet(name: \u0026str) {\n    alert(\u0026format!(\"Hello, {}!\", name));\n}\n```\n\nUse exported Rust things from JavaScript with ECMAScript modules!\n\n```js\nimport { greet } from \"./hello_world\";\n\ngreet(\"World!\");\n```\n\n## Features\n\n* **Lightweight.** Only pay for what you use. `wasm-bindgen` only generates\n  bindings and glue for the JavaScript imports you actually use and Rust\n  functionality that you export. For example, importing and using the\n  `document.querySelector` method doesn't cause `Node.prototype.appendChild` or\n  `window.alert` to be included in the bindings as well.\n\n* **ECMAScript modules.** Just import WebAssembly modules the same way you would\n  import JavaScript modules. Future compatible with [WebAssembly modules and\n  ECMAScript modules integration][wasm-es-modules].\n\n* **Designed with the [\"Web IDL bindings\" proposal][webidl-bindings] in mind.**\n  Eventually, there won't be any JavaScript shims between Rust-generated wasm\n  functions and native DOM methods. Because the Wasm functions are statically\n  type checked, some of those native methods' dynamic type checks should become\n  unnecessary, promising to unlock even-faster-than-JavaScript DOM access.\n\n[wasm-es-modules]: https://github.com/WebAssembly/esm-integration\n[webidl-bindings]: https://github.com/WebAssembly/proposals/issues/8\n\n## Guide\n\n[**📚 Read the `wasm-bindgen` guide here! 📚**](https://rustwasm.github.io/docs/wasm-bindgen/)\n\nYou can find general documentation about using Rust and WebAssembly together\n[here](https://rustwasm.github.io/docs).\n\n## API Docs\n\n- [wasm-bindgen](https://docs.rs/wasm-bindgen)\n- [js-sys](https://docs.rs/js-sys)\n- [web-sys](https://docs.rs/web-sys)\n- [wasm-bindgen-futures](https://docs.rs/wasm-bindgen-futures)\n\n## MSRV Policy\n\nLibraries that are released on [crates.io](https://crates.io) have a MSRV of v1.57. Changes to the MSRV will be accompanied by a minor version bump.\n\nCLI tools and their corresponding support libraries have a MSRV of v1.76. Changes to the MSRV will be accompanied by a patch version bump.\n\n## License\n\nThis project is licensed under either of\n\n * Apache License, Version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or\n   http://www.apache.org/licenses/LICENSE-2.0)\n * MIT license ([LICENSE-MIT](LICENSE-MIT) or\n   http://opensource.org/licenses/MIT)\n\nat your option.\n\n## Contribution\n\n**[See the \"Contributing\" section of the guide for information on\nhacking on `wasm-bindgen`!][contributing]**\n\nUnless you explicitly state otherwise, any contribution intentionally submitted\nfor inclusion in this project by you, as defined in the Apache-2.0 license,\nshall be dual licensed as above, without any additional terms or conditions.\n\n[contributing]: https://rustwasm.github.io/docs/wasm-bindgen/contributing/index.html\n","funding_links":["https://github.com/sponsors/daxpedda"],"categories":["Development tools","Rust","开发工具 Development tools","Libraries","JavaScript框架","开发工具","语言资源库","Crates","wasm","Projects"],"sub_categories":["FFI","FFI FFI","Interfacing with JavaScript and the DOM","其他_文本生成、文本对话","rust","示例 FFI","Wasm","Libraries"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frustwasm%2Fwasm-bindgen","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frustwasm%2Fwasm-bindgen","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frustwasm%2Fwasm-bindgen/lists"}