Crate rusty_nodejs_repl

source ·
Expand description

This crate lets you run arbitrary code in a Node.js REPL from Rust. Use Config to setup the REPL and use Repl to interact with it.

let mut context: Repl = Config::build()?.start()?;
let result = context.repl("console.log('Hello, world!');").await?;
assert_eq!(result, b"Hello, world!\n");
context.stop().await?;

The REPL is run in it’s own tempfile::TempDir. So anyfiles created alongside it will be cleaned up on exit.

Structs§

Enums§