slimline::section::nodejs::precmd() {
  unset slimline_section_nodejs_output
}

slimline::section::nodejs::async_task() {
  echo "$(node -v 2>/dev/null)"
}

slimline::section::nodejs::async_task_complete() {
  local output="${3}"
  slimline_section_nodejs_output="${output}"
}

slimline::section::nodejs::render() {
  if [[ ! -f "package.json" && ! -d "node_modules" ]]; then return; fi
  if [[ -z "${slimline_section_nodejs_output}" ]]; then return; fi
  slimline::utils::expand "nodejs" "%F{white}[%F{green}⬢ |version|%F{white}]%f" \
      "version" "${slimline_section_nodejs_output}"
}

slimline::section::nodejs::precmd() {
  unset slimline_section_nodejs_output
}

slimline::section::nodejs::async_task() {
  command node -v 2>/dev/null
}

slimline::section::nodejs::async_task_complete() {
  local output="${3}"
  slimline_section_nodejs_output="${output}"
}

slimline::section::nodejs::render() {
  if [[ ! -f "package.json" && ! -d "node_modules" ]]; then return; fi
  if [[ -z "${slimline_section_nodejs_output}" ]]; then return; fi
  slimline::utils::expand "nodejs" "%F{white}[%F{green}⬢ |version|%F{white}]%f" \
      "version" "${slimline_section_nodejs_output}"
}

Use command builtin instead of command substitution
Use command builtin instead of command substitution
