Access JavaScript from Rust
Use JavaScript modules to access the file system, network, databases, and other system resources
This page is outdated. Please visit here to see how to access JavaScript from Rust.
#[wasm_bindgen]
pub fn utc_now() {
let now: String = nodejs_helper::date::utc_string();
nodejs_helper::console::log("UTC time: ");
nodejs_helper::console::log(&now);
}Prerequisite
$ npm i ssvm sync-request better-sqlite3
$ npm i -g wasm-pack[dependencies]
wasm-bindgen = "=0.2.61"
nodejs-helper = "0.0.3"Building and running
Example: system time and console
Example: Sqlite database access
Example: HTTP network access
Example: File system access and performance profiler
Last updated
Was this helpful?