Skip to main content

Crate libdeno

Crate libdeno 

Source
Expand description

libdeno — embed the Deno runtime in Rust with direct npm support.

Runs a JS/TS entry file (or a local package.json project) on the official deno module graph pipeline: npm: specifiers, remote modules, deno.json import maps, jsr:, CJS packages, wasm, .node native addons, web workers and child_process.fork are all handled by the graph loader.

use libdeno::{LibdenoOptions, run};

let options = LibdenoOptions {
  permissions: vec!["--allow-read=.".into(), "--allow-net=example.com".into()],
  args: vec![],
  cwd: None,
};
let exit_code = run("app.js", &options).unwrap();

Structs§

LibdenoOptions
Options for a single run invocation.

Enums§

LibdenoError
Errors from a run invocation.

Statics§

RESIDUAL_LAZY_ESM
RESIDUAL_LAZY_JS

Functions§

maybe_handle_child_mode
Services a child-run request when this process was spawned by run_in_subprocess.
run
Runs entry (a file, a directory, or a package.json) to completion and returns the exit code the script requested (0 on normal completion).
run_in_subprocess
Runs entry in a child process and returns its exit code.