jstime_core 0.55.0

Another JS Runtime
Documentation

jstime Core Crate

The main dependency of this crate is rusty_v8 which provides the V8-Rust bindings.

Features

API

use jstime_core as jstime;

fn main() {
    jstime::init(None);
    let mut scope = jstime::JSTime::new(
        jstime::Options::default()
    );
    scope.run_script("console.log('Hello, World!');", "jstime")
        .expect("ruhroh something went wrong");
}

Using Temporal API

The Temporal API is available globally in all scripts:

use jstime_core as jstime;

fn main() {
    jstime::init(None);
    let mut scope = jstime::JSTime::new(
        jstime::Options::default()
    );
    
    // Use Temporal API
    scope.run_script(r#"
        const date = new Temporal.PlainDate(2025, 10, 13);
        console.log('Date:', date.year, date.month, date.day);
        
        const now = Temporal.Now.instant();
        console.log('Current instant:', now.epochNanoseconds);
    "#, "jstime").expect("script failed");
}