-
Notifications
You must be signed in to change notification settings - Fork 5.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature request: CLI available as library #7928
Comments
We had |
This would be very useful, I'm trying to create a plug-in system where the JS/WASM plug-ins can run in the browser and server unchanged using the |
This is not possible, |
@bartlomieju , Currently the way to reuse any of cli internal implementations is to fork the repo and add the required Also, are there any parts that can be exposed initially? Specifically the |
@jahtalab my comment from above still holds (#7928 (comment)). Every release introduces a lot of changes in Rust code, eg. |
Would it be possible to only expose a "pipe" interface to the CLI? That would be trivially stable and that way we could embed Deno easily and avoid the overhead of shelling out, even if it's not as fancy as a proper API. |
@trevyn I'm not sure what you're suggesting here, could you elaborate? |
Like, instead of the CLI reading/writing to One way would be to mimic the interface to |
That sounds quite hacky 🤔 besides cli args/flags don't come from the stdin, does the cli even read anything from stdin? and what is the output of a command? do I have to write a parser for whatever different commands output? |
@andybarron @olanod @jahtalab @trevyn we now provide library crate that exposes runtime functionalities of Deno: https://crates.io/crates/deno_runtime |
I'm working on a project where I'd like to instantiate multiple instances of the full Deno runtime from within Rust code. Because the
cli
package only provides a binary, that isn't currently possible. I'd like to avoid the inefficiencies of shelling out to multiple separate Deno processes, and instead spin them up in Rust threads.Adding a
[lib]
target toCargo.toml
in thecli
package would fix this, but it would probably require changes to the package to expose a Rust API with all of the CLI options.The text was updated successfully, but these errors were encountered: