1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
use super::super::ActModule; use crate::Result; pub struct Os; impl Os { pub fn new() -> Self { Self } } impl ActModule for Os { fn init(&self, ctx: &rquickjs::Ctx<'_>) -> Result<()> { ctx.globals().set("os", std::env::consts::OS)?; Ok(()) } }