Skip to main content

nodejs/
banner.rs

1//! The REPL wordmark. Deliberately NOT printed on startup — the interactive
2//! `node --repl` shows a bare prompt with no banner, version stripe, or welcome
3//! message (house rule: prompt appears immediately, no startup chatter). Kept as
4//! a reusable asset should an explicit, user-requested `--version`-style banner
5//! ever be wanted.
6
7use nu_ansi_term::Color;
8
9/// ANSI-Shadow wordmark, matching the house cyberpunk style.
10pub const WORDMARK: &str = r#"
11███╗   ██╗ ██████╗ ██████╗ ███████╗
12████╗  ██║██╔═══██╗██╔══██╗██╔════╝
13██╔██╗ ██║██║   ██║██║  ██║█████╗
14██║╚██╗██║██║   ██║██║  ██║██╔══╝
15██║ ╚████║╚██████╔╝██████╔╝███████╗
16╚═╝  ╚═══╝ ╚═════╝ ╚═════╝ ╚══════╝
17"#;
18
19/// Render the banner + a one-line subtitle. Not called on REPL startup; provided
20/// for any explicit user-requested invocation.
21pub fn print_banner() {
22    let v = env!("CARGO_PKG_VERSION");
23    println!("{}", Color::Cyan.bold().paint(WORDMARK));
24    println!(
25        "{} {}  {}",
26        Color::Purple.bold().paint("node-js"),
27        Color::White.paint(format!("v{v}")),
28        Color::DarkGray.paint("JavaScript on fusevm — bytecode VM + Cranelift JIT")
29    );
30}