pub fn module<'a>(context: &'a Context) -> Option<Module<'a>> {
    match get_package_version() {
        Some(package_version) => {
            const PACKAGE_CHAR: &str = "📦 ";

            let mut module = context.new_module("package");
            let module_style = module
                .config_value_style("style")
                .unwrap_or_else(|| Color::Red.bold());
            module.set_style(module_style);
            module.get_prefix().set_value("is ");

            module.new_segment("symbol", PACKAGE_CHAR);
            module.new_segment("version", &package_version);

            Some(module)
        }
        None => None,
    }
}
/// Creates a module with the current package version
///
/// Will display if a version is defined for your Node.js or Rust project (if one exists)
Creates a module with the current package version
Will display if a version is defined for your Node.js or Rust project (if one exists)
Creates a module with the current package version Will display if a version is defined for your Node . js or Rust project ( if one exists )
pub fn module<'a>(context: &'a Context) -> Option<Module<'a>> {
    match get_package_version() {
        Some(package_version) => {
            const PACKAGE_CHAR: &str = "📦 ";
            let mut module = context.new_module("package");
            let module_style = module
                .config_value_style("style")
                .unwrap_or_else(|| Color::Red.bold());
            module.set_style(module_style);
            module.get_prefix().set_value("is ");
            module.new_segment("symbol", PACKAGE_CHAR);
            module.new_segment("version", &package_version);
            Some(module)
        }
        None => None,
    }
}
pub fn module < ' a > ( context : & ' a Context ) -> Option < Module < ' a > > { match get_package_version ( ) { Some ( package_version ) => { const PACKAGE_CHAR : & str = " let mut module = context . new_module ( " " ) ; let module_style = module . config_value_style ( " " ) . unwrap_or_else ( | | Color :: Red . bold ( ) ) ; module . set_style ( module_style ) ; module . get_prefix ( ) . set_value ( " " ) ; module . new_segment ( " " , PACKAGE_CHAR ) ; module . new_segment ( " " , & package_version ) ; Some ( module ) } None => None , } }
Creates a module with the current package version
Will display if a version is defined for your Node.js or Rust project (if one exists)
Creates a module with the current package version Will display if a version is defined for your Node . js or Rust project ( if one exists )
context
&'a Context