quickjs-rs
quickjs-rs copied to clipboard
Rust wrapper for the quickjs Javascript engine.
This PR provides a custom serde data format for serializing/deserializing Rust data structures into/from `JsValue`. *Serialization Example*: ```rust #[derive(Serialize)] struct Test { int: u32, seq: Vec, } // deserialization example:...
This PR adds module support (not binary modules, just other files imported via the ES6 module syntax) and the js timer API (setTimeout, clearTimeout). I wasn't really happy with bindings.rs...
I want to add struct,like this: ``` struct User { username: String, email: String, sign_in_count: u64, active: bool, } fn build_user(email: String, username: String) -> User { User { email,...
Recently I've discovered [`scopeguard` crate](https://docs.rs/scopeguard/1.0.0/scopeguard/). It allows to do RAII-style cleanup of resources similarly to what [`DroppableValue`](https://github.com/theduke/quickjs-rs/blob/master/src/droppable_value.rs#L1) structure does, but also provides a nice [`defer!`](https://docs.rs/scopeguard/1.0.0/scopeguard/#defer) macro to do it in...
Using ```rust let ctx = Context::builder().console(quick_js::console::LogConsole).build()?; ``` and later I evaluate some code that uses `console.log`, the code will run but nothing will be printed.
`copy_dir` is quite outdated and tends to introduce a duplicate dependency on `walkdir`. We can either ship a compressed version of the code, which is then uncompressed instead of copying...
Provide a clean error message when building -sys on Windows with msvc. (Just a reminder for myself)
I'm embedding this in a rendering application where rendered objects can be scripted in the frontend. The problem is that the rendered objects are managed in Rust but created in...
Hi, Thank you so much for this wrapper! I'm running into some problems when loading modules, all I get back is `ReferenceError: could not load module` when running for example...
Is there any way to convert `{"x": Int(1), "y": Int(2)}` into `HashMap - {"x": 1, "y": 2}` or `Array([Int(1), Int(2), Int(3)])` into `Vec[1,2,3]`? Full code: ```rust let context = Context::new().unwrap();...