laurencerowe
6 days ago
> To gain access to the Deno (and Node.js compat) standard library used by Deno requires forking deno_cli as they have largely coupled these additions to the main executable.
This is no longer the case. While it does not currently provide a stable API, that functionality exists in the deno_runtime crate and is relatively easy to reuse.
apatheticonion
4 days ago
The deno_runtime crate is indeed easy to use however the exts that provide compat for web apis and Nodejs compat still require forking deno_cli. You can use some of their ext crates https://github.com/denoland/deno/tree/main/ext but not everything.
Also using ops within Workers is challenging, particularly if they share state.
laurencerowe
a day ago
The web api extensions and Nodejs compatibility stuff are now in deno_runtime: https://github.com/denoland/deno/blob/main/runtime/Cargo.tom...
The CLI only depends on them transitively via deno_runtime: https://github.com/denoland/deno/blob/main/cli/Cargo.toml
For instance I was able to run the following script using just deno_runtime with https://github.com/lrowe/deno_varnish/blob/main/src/main.rs
import { DatabaseSync } from "node:sqlite";
console.log(new DatabaseSync(":memory:").prepare("SELECT 1").get());
apatheticonion
7 hours ago
Huh, it's come a long way since I last looked at it