Documentation
¶
Overview ¶
nvm-common has common methods for use in both nvm and nvm-shim
Index ¶
Constants ¶
const CONFIG_NAME = "config.json"
config filename
const CONFIG_PERM = 0644
config file permissions
const NVM_DIR string = ".nevermind"
user-relative path to app directory
const NVM_SHIM = "nvm-shim"
basename of binary in NVM_DIR
Variables ¶
var DEBUG = os.Getenv("DEBUG")
Enables debugger with DEBUG=1
If you want node logs too, set DEBUG=*
Functions ¶
func CreateSymlinks ¶ added in v0.1.7
create symlinks of bins
func Debugger ¶
func Debugger()
sets up logger if DEBUG=1
logging is disabled by default, but you could also pass DEBUG=0 if that's something you think you need to do
func GetNVMDir ¶
get a path relative to common.NVM_DIR returns directory string, and error
func GetNodeBin ¶
bin should likely be "node", "npm", "npx"; or any other node bin installed globally (e.g. yarn, typescript) returns directory string, and error
Types ¶
type Version ¶
type Version string
a semver string without the leading "v" returned by common.GetVersion
func GetVersion ¶
case-insensitive, leading v, major.minor.patch
func (Version) IsSpecific ¶ added in v0.1.5
has all major.minor.patch
type VersionError ¶ added in v0.1.6
type VersionError struct {
// contains filtered or unexported fields
}
func (VersionError) Error ¶ added in v0.1.6
func (ve VersionError) Error() string