Rusty Node.js REPL 🦀 🌳 🌀
$ cargo add rusty_nodejs_repl
Usage
Put some JavaScript in a string and pass it to Repl::run
. The function will return whatever was sent to stdout
:
let mut repl = build?.start?;
let result = repl.run.await?;
assert_eq!;
For more in-depth usage see the test in the Rust Hypercore Replicator.
What?
A way run arbitrary code through Node.js from Rust.
Why?
This is for testing. When working on Node.js related Rust projects it can allow you to co-locate JavaScript along side your Rust.
This crate came from implementing parts of the Hypercore JS ecosystem in Rust. Which requires testing Rust output against JavaScript.