Starship Prompt Builder

Node.js module

Show the active Node.js version when the current project or files indicate a JavaScript runtime.

When it appears

It appears when Node.js is available and the directory contains configured extensions, files, or folders.

Preview

Rendered from the starting configuration in a representative simulated environment.

starship — preview
via  v1.2.3 

Starting configuration

[nodejs]
symbol = " "
format = "via [$symbol($version )]($style)"
style = "bold green"
Open in the builder

The configuration is compressed into the URL fragment and stays in your browser.

Key options

formatstring
The format for the module.
symbolstring
A format string representing the symbol of Node.js.
stylestring
The style for the module.
version_formatstring
The version format. Available vars are raw, major, minor, & patch
detect_extensionsarray
Which extensions should trigger this module.
detect_filesarray
Which filenames should trigger this module.
detect_foldersarray
Which folders should trigger this module.

Format variables

$symbol
Mirrors the value of option symbol
$version
The version of node
$engines_version
node version requirement as set in the engines property of package.json. Will only show if the version requirement does not match the node version.

Common adjustments

  • Tune detection lists if the module appears in non-Node repositories or misses a monorepo.
  • Use version_format to choose raw, major, minor, and patch version detail.
  • Keep the version group conditional so an unavailable version leaves no dangling text.