{"id":21846939,"url":"https://github.com/duyet/deno-runner-rs","last_synced_at":"2025-10-24T04:06:33.889Z","repository":{"id":211683488,"uuid":"729731081","full_name":"duyet/deno-runner-rs","owner":"duyet","description":"Run Javascript inside Rust","archived":false,"fork":false,"pushed_at":"2025-04-11T20:32:02.000Z","size":38,"stargazers_count":2,"open_issues_count":3,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-11T21:35:30.538Z","etag":null,"topics":[],"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/duyet.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-12-10T06:57:16.000Z","updated_at":"2024-11-07T07:18:40.000Z","dependencies_parsed_at":"2024-01-25T02:31:51.025Z","dependency_job_id":"0f0d6439-1d4a-41f4-8416-2c14b5afbe0b","html_url":"https://github.com/duyet/deno-runner-rs","commit_stats":null,"previous_names":["duyet/deno-runner-rs"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/duyet%2Fdeno-runner-rs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/duyet%2Fdeno-runner-rs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/duyet%2Fdeno-runner-rs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/duyet%2Fdeno-runner-rs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/duyet","download_url":"https://codeload.github.com/duyet/deno-runner-rs/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248888843,"owners_count":21178113,"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":[],"created_at":"2024-11-27T23:16:11.930Z","updated_at":"2025-10-24T04:06:28.864Z","avatar_url":"https://github.com/duyet.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Javascript runner in Rust\n\n[![cargo-test](https://github.com/fossil-engineering/deno-runner-rs/actions/workflows/cargo-test.yaml/badge.svg)](https://github.com/fossil-engineering/deno-runner-rs/actions/workflows/cargo-test.yaml)\n[![cargo-doc](https://github.com/fossil-engineering/deno-runner-rs/actions/workflows/cargo-doc.yaml/badge.svg)](https://github.com/fossil-engineering/deno-runner-rs/actions/workflows/cargo-doc.yaml)\n[![cargo-clippy](https://github.com/fossil-engineering/deno-runner-rs/actions/workflows/cargo-clippy.yml/badge.svg)](https://github.com/fossil-engineering/deno-runner-rs/actions/workflows/cargo-clippy.yml)\n[![codecov](https://codecov.io/gh/fossil-engineering/deno-runner-rs/branch/master/graph/badge.svg?token=TiJMubpWuH)](https://codecov.io/gh/fossil-engineering/deno-runner-rs)\n\nThis runner using [deno_core](https://crates.io/crates/deno_core) with additional helper function to run Javascript inside Rust.\nYou can also binding the Rust functions into Javascript.\n\n# Usage\n\nAdd this crate to your Cargo.toml \n\n```toml\n[dependencies]\ndeno_runner = { git = \"https://github.com/fossil-engineering/deno-runner-rs\" }\n```\n\n## Example\n\nBasic usage\n\n```rust\nuse deno_runner::Builder;\nuse std::collections::HashMap;\n\n#[tokio::main]\nasync fn main() {\n    let code = r#\"\n        const add = (a, b) =\u003e a + b;\n        add(a, b)\n    \"#;\n\n    let runner = Builder::new().build();\n    let vars = HashMap::from([(\"a\", 1), (\"b\", 2)]);\n\n    let result = runner.run(code, Some(vars)).await.unwrap();\n\n    assert_eq!(result, \"3\");\n}\n```\n\nCalling Rust functions from Javascript\n\n```rust\nuse deno_runner::{anyhow::Result, op, Builder};\nuse std::collections::HashMap;\n\n#[op]\nfn add(a: i32, b: i32) -\u003e i32 {\n    a + b\n}\n\n#[tokio::main]\nasync fn main() {\n    let code = \"add(a, b)\";\n\n    let runner = Builder::new().add_op(add::decl()).build();\n    let vars = HashMap::from([(\"a\", 1), (\"b\", 2)]);\n\n    let result = runner.run(code, Some(vars)).await.unwrap();\n\n    assert_eq!(result, \"3\");\n}\n```\n\n# License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fduyet%2Fdeno-runner-rs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fduyet%2Fdeno-runner-rs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fduyet%2Fdeno-runner-rs/lists"}