Skip to content

a-ovi/runjs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

runjs

Lightweight Rust example that embeds a JavaScript runtime using deno_core.

This repository contains a minimal Rust program that loads and runs JavaScript files from src/ using the Deno core crate. It demonstrates how to host and execute JS from Rust with an embedded runtime.

Requirements:

  • Rust toolchain with cargo (stable channel)

Files:

  • src/main.rs: Rust entry point that boots the JS runtime.
  • src/runtime.js: Runtime helper code used by the Rust host.
  • src/example.js: Example JavaScript file demonstrating usage.

Build & Run

Build (debug):

cargo build

Run the program:

cargo run

For an optimized build:

cargo build --release
./target/release/runjs-test

Note: cargo run automatically builds and runs the binary.

How to use

  • Edit or add JavaScript files in src/ (for example, src/example.js).
  • The Rust host (src/main.rs) will load/execute or import these scripts via the embedded deno_core runtime.

Development tips

  • Make small changes to src/example.js and re-run cargo run to iterate quickly.
  • Use cargo build --release when benchmarking or preparing a distribution.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors