Something went wrong. Try again.
A napi-rs with `Env<'env> + Scope<'env, 'scope> + Local<'scope>`, subclass supported, safe rust
javascript typescript node-api napi node-addon rust nodejs
Something went wrong. Try again.
12345678910111213141516171819202122232425262728use std::fmt;use std::io::Write;
use anstyle::{AnsiColor, Color, Style};
const GREEN_BOLD: Style = Style::new() .fg_color(Some(Color::Ansi(AnsiColor::Green))) .bold();const YELLOW_BOLD: Style = Style::new() .fg_color(Some(Color::Ansi(AnsiColor::Yellow))) .bold();const RESET: anstyle::Reset = anstyle::Reset;
pub fn status(label: &str, message: impl fmt::Display) { let _ = writeln!( anstream::stderr(), "{GREEN_BOLD}{label:>12}{RESET} {message}" );}
pub fn warn(message: impl fmt::Display) { let label = "warning"; let _ = writeln!( anstream::stderr(), "{YELLOW_BOLD}{label:>12}:{RESET} {message}" );}