wasm-rquickjs 0.2.3

Tool for wrapping JavaScript modules as WebAssembly components using the QuickJS engine
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
// JS functions for the unified node:events module (EventEmitter + Event/EventTarget/CustomEvent)
pub const EVENTS_JS: &str = include_str!("events.js");

// Re-export for aliases
pub const REEXPORT_JS: &str =
    r#"export * from 'node:events'; export { default } from 'node:events';"#;

// JS code wiring Event, EventTarget, and CustomEvent into the global context
pub const WIRE_JS: &str = r#"
        import { Event, EventTarget, CustomEvent } from 'node:events';
        globalThis.Event = Event;
        globalThis.EventTarget = EventTarget;
        globalThis.CustomEvent = CustomEvent;
    "#;