JS Utils Kit
    Preparing search index...

    Function envRef

    • Get a shell-compatible reference to an environment variable.

      Parameters

      • v: string

        Environment variable name

      Returns string

      • This helper returns a string that can be used inside shell commands to reference an environment variable.
      • The format differs between operating systems:
        • Unix/Linux/macOS → $VAR
        • Windows (cmd) → %VAR%
      • Supported shells:
        • cmd
        • bash / sh / zsh (POSIX)

      This is useful when constructing shell commands dynamically.

      envRef("PATH")
      // Linux/macOS → "$PATH"
      // Windows → "%PATH%"