{"id":20331884,"url":"https://github.com/grafbase/getting-started-with-rust-wasm","last_synced_at":"2025-05-08T01:31:15.659Z","repository":{"id":178922233,"uuid":"662572317","full_name":"grafbase/getting-started-with-rust-wasm","owner":"grafbase","description":"Rust ➡ WebAssembly for Webpack, Node.js and Deno","archived":true,"fork":false,"pushed_at":"2023-12-15T02:44:36.000Z","size":55,"stargazers_count":13,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-29T10:28:22.532Z","etag":null,"topics":["blog","deno","educational-project","javascript","js","nodejs","rust","rust-lang","template","ts","typescript","wasm","wasm-bindgen","wasm-pack","webassembly","webpack"],"latest_commit_sha":null,"homepage":"https://grafbase.com/blog/getting-started-with-rust-and-webassembly","language":"Nix","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/grafbase.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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}},"created_at":"2023-07-05T12:24:11.000Z","updated_at":"2025-01-14T11:41:42.000Z","dependencies_parsed_at":"2023-12-15T03:39:34.959Z","dependency_job_id":"7d1145d3-5b7e-4319-92ca-7235c47f075c","html_url":"https://github.com/grafbase/getting-started-with-rust-wasm","commit_stats":null,"previous_names":["grafbase/getting-started-with-rust-wasm"],"tags_count":0,"template":true,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/grafbase%2Fgetting-started-with-rust-wasm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/grafbase%2Fgetting-started-with-rust-wasm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/grafbase%2Fgetting-started-with-rust-wasm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/grafbase%2Fgetting-started-with-rust-wasm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/grafbase","download_url":"https://codeload.github.com/grafbase/getting-started-with-rust-wasm/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252981497,"owners_count":21835436,"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":["blog","deno","educational-project","javascript","js","nodejs","rust","rust-lang","template","ts","typescript","wasm","wasm-bindgen","wasm-pack","webassembly","webpack"],"created_at":"2024-11-14T20:23:58.287Z","updated_at":"2025-05-08T01:31:15.107Z","avatar_url":"https://github.com/grafbase.png","language":"Nix","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003eGetting Started With Rust and WebAssembly\u003c/h1\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003cimg width=\"600\" alt=\"A design with Rust's Ferris and the WebAssembly logo\" src=https://github.com/grafbase/getting-started-with-rust-wasm/assets/14347895/384e5505-d68d-466a-a280-5fd95eb52853\" /\u003e\u003cbr /\u003e\u003cbr /\u003e\n  Rust ➡ WebAssembly for Webpack, Node.js and Deno\u003cbr /\u003eSee \u003ca href=\"https://grafbase.com/blog/getting-started-with-rust-and-webassembly\"\u003eGetting started with Rust and WebAssembly\u003c/a\u003e\n\u003c/p\u003e\n\n# Try It Out\n\n\u003ca href=\"https://codesandbox.io/p/sandbox/github/grafbase/getting-started-with-rust-wasm\"\u003e\u003cimg alt=\"CodeSandbox: getting-started-with-rust-wasm\" src=\"https://img.shields.io/badge/CodeSandbox-getting--started--with--rust--wasm-866eff?labelColor=343434\" /\u003e\u003c/a\u003e\n\n# Setup\n\n## Webpack\n\n- [Install Rust](https://www.rust-lang.org/learn/get-started)\n- [Install Node.js](https://nodejs.org/)\n- [Install `wasm-pack`](https://rustwasm.github.io/wasm-pack/installer/)\n- Run `npm install`\n\n## Node.js\n\n- [Install Rust](https://www.rust-lang.org/learn/get-started)\n- [Install Node.js](https://nodejs.org/)\n- [Install `wasm-pack`](https://rustwasm.github.io/wasm-pack/installer/)\n  - Alternatively, [install `cargo-make`](https://github.com/sagiegurari/cargo-make#installation)\n\n## Deno\n\n- [Install Rust](https://www.rust-lang.org/learn/get-started)\n- [Install Node.js](https://nodejs.org/)\n- [Install `cargo-make`](https://github.com/sagiegurari/cargo-make#installation)\n\n## With Nix\n\n1. [Install Nix](https://nixos.org/download.html)\n2. [Activate Flakes](https://nixos.wiki/wiki/Flakes)\n3. [Install direnv](https://direnv.net/)\n4. [Install nix-direnv](https://github.com/nix-community/nix-direnv)\n5. Add the following `.envrc` file:\n\n   ```sh\n   use flake  # activates the flake\n   dotenv_if_exists .env  # optionally loads a .env file if it exists\n   ```\n\n6. Run `direnv allow .` inside the project directory to allow Direnv to execute the `.envrc`\n7. For Webpack, also run `npm install`\n\n# Usage\n\n## Node.js\n\n### With `wasm-pack`\n\n1. `wasm-pack build --target nodejs` - Builds and generates bindings for `src/lib.rs`\n2. `node src/node.mjs` - Runs `src/node.mjs`\n\n### With `cargo-make`\n\n- `cargo make run-node` - Runs `src/node.mjs`\n\n## Webpack\n\n1. `npm run serve`\n2. Open [http://localhost:8080](http://localhost:8080/)\n\n## Deno\n\n- `cargo make run-deno` - Runs `src/deno.ts`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgrafbase%2Fgetting-started-with-rust-wasm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgrafbase%2Fgetting-started-with-rust-wasm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgrafbase%2Fgetting-started-with-rust-wasm/lists"}