{"id":15890554,"url":"https://github.com/dimfeld/js_sidecar","last_synced_at":"2026-02-03T21:31:24.129Z","repository":{"id":250942454,"uuid":"835509530","full_name":"dimfeld/js_sidecar","owner":"dimfeld","description":"Maintain a pool of JavaScript engines from a Rust application","archived":false,"fork":false,"pushed_at":"2024-08-05T21:31:49.000Z","size":194,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-25T02:23:06.888Z","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":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dimfeld.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"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}},"created_at":"2024-07-30T01:48:39.000Z","updated_at":"2024-08-05T21:31:52.000Z","dependencies_parsed_at":"2024-10-27T16:32:44.702Z","dependency_job_id":"071e3201-0f32-46d9-8fe9-b620e9900427","html_url":"https://github.com/dimfeld/js_sidecar","commit_stats":null,"previous_names":["dimfeld/js_sidecar"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/dimfeld/js_sidecar","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dimfeld%2Fjs_sidecar","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dimfeld%2Fjs_sidecar/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dimfeld%2Fjs_sidecar/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dimfeld%2Fjs_sidecar/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dimfeld","download_url":"https://codeload.github.com/dimfeld/js_sidecar/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dimfeld%2Fjs_sidecar/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29058241,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-03T20:13:53.544Z","status":"ssl_error","status_checked_at":"2026-02-03T20:13:40.507Z","response_time":96,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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-10-06T07:06:42.997Z","updated_at":"2026-02-03T21:31:24.112Z","avatar_url":"https://github.com/dimfeld.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"js_sidecar is a Rust crate which, instead of embedding a JS library directly into the application, passes JavaScript\ncode to a separate, persistent Node.js process for execution.\n\nIt's somewhat difficult right now to embed a well-equipped JS engine into your application if you want to have full API\navailability, and so this gets around that problem while avoiding the overhead of starting a new process for every\nexpression evaluation.\n\n## Performance\n\nSome relevant timings from the benchmarks (`cargo bench`), run on an M3 Max Macbook Pro and Node 20.16.\n\n- A simple script execution (\"2 + 2\") takes a bit under 200us to send the code to Node.js, run it, and return the result.\n- A ping-style message from the Rust host to Node.js and back, without running any code, takes about 13us.\n\n## Alternatives\n\n### Embedding Deno\n\nIn [my experience in the past](https://github.com/dimfeld/ergo/tree/master/js) this worked out ok, but you have to set\nup a lot of runtime stuff yourself. Updating all the Deno crates together was also a pain and there were often breaking\nchanges to be handled. Some of this might be better now as Deno itself has matured, but overall it seemed that embedding\na \"full-featured Deno\" is not really easy without copying a bunch of code from the Deno repository itself.\n\n### QuickJS/Boa/etc\n\nThe primary issues here are in ecosystem compatibility and API availability, most notably the lack of `fetch`. This may\nnot be an issue for some applications, but sometimes you need APIs which only really work in JS engines which are\ncompatible with Node or WinterCG.\n\nAs QuickJS gets more WinterCG APIs through the LLRT project, this also may be less of an issue. And Boa, a JS runtime\nwritten in Rust, is in early days but also looks promising.\n\n## Downsides Compared to Embedding\n\nThis requires Node.js to be installed on the system, which can complicate distribution and may make this a non-starter\nfor certain use cases. In the future I may look into embedding the Bun executable directly, to allow self-contained\nusage when desired.\n\nThe primary downside is that every communication needs to go through a Unix socket, which lowers performance somewhat.\nThis won't be an issue for most cases, especially since zero-copy isn't really possible going into an embedded JS engine\nanyway, but is worth considering.\n\nCases that use a lot of callbacks from the script into the Rust host will see the largest performance degradation. (This\nalso isn't supported yet with this crate but is planned for the future.) \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdimfeld%2Fjs_sidecar","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdimfeld%2Fjs_sidecar","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdimfeld%2Fjs_sidecar/lists"}