@pnpm/os.env.path-extender-windows
v1100.0.1
Published
A module for adding a new directory to the Path environment variable of the Windows Registry
Readme
@pnpm/os.env.path-extender-windows
A module for adding a new directory to the Path environment variable of the Windows Registry
Usage
This adds a PNPM_HOME environment variable with the specified directory. And prepends the value of PNPM_HOME to the Path:
import { addDirToWindowsEnvPath } from '@pnpm/os.env.path-extender-windows'
await addDirToWindowsEnvPath('C:\\pnpm', {
// This is optional as 'start' is the default value.
// You may also use 'end'
position: 'start',
// This is the name of the additional env variable that holds the directory.
// If not set, no additional env variable is used.
proxyVarName: 'PNPM_HOME',
// If PNPM_HOME already exist, overwrite it
overwriteProxyVar: true,
})
//> PNPM_HOME=C:\pnpm
// Path=%PNPM_HOME%;C:\foo;C:\barThis prepends C:\pnpm to the Path (no additional environment variable is created:
import { addDirToWindowsEnvPath } from '@pnpm/os.env.path-extender-windows'
await addDirToWindowsEnvPath('C:\\pnpm')
//> Path=C:\pnpm;C:\foo;C:\barLicense
MIT
