Arend
Arend7mo ago

If I want to integrate a fully featured Deno runtime into my application, where do I start?

I want to create a scripting environment for my application that will enable people to create custom integrations/workflows. I'm investigating if I can use Deno for this use case, but if we present it as an embedded Deno runtime to our users, I think they will also expect compatibility with all the things Deno offers as well. That means TypeScript compatibility, NPM compatibility on par with Deno's, being able to import from URLs, etc.. From my understanding a lot of that logic is implemented in the CLI only, but I would like to integrate in our own process, so ideally I would just import a Rust crate. Can the CLI crate itself maybe be linked to?
7 Replies
PastelStoic
PastelStoic7mo ago
IIRC the core deno runtime is its own crate
PastelStoic
PastelStoic7mo ago
GitHub
deno/Cargo.toml at main · denoland/deno
A modern runtime for JavaScript and TypeScript. Contribute to denoland/deno development by creating an account on GitHub.
PastelStoic
PastelStoic7mo ago
I'm sure you could provide an alternate entry point rather than the CLI it'll probably end up being a lot more complicated than a single import, but you can probably strip out a fair bit of complexity
bartlomieju
bartlomieju7mo ago
Can the CLI crate itself maybe be linked to?
We don't distribute CLI as a standalone crate. There are some community crates that do that, but I don't know if they're maintained and we give no guarantees if they're okay
Arend
Arend7mo ago
Right thanks, I think indeed I can fork the deno crate and add an entry point for my use case or otherwise lift the pieces I need from that crate, depending on feasibility looks like it's a pretty huge crate though, would have been great if components such as tsc and npm were split off into their own crates too
PastelStoic
PastelStoic7mo ago
this isn't exactly a common use case, so there's not much reason for the devs to do that - but others like you would appriciate it, I'm sure
Arend
Arend7mo ago
Yeah, that’s fair 🙂