Manage environment variables, PATH, and rc files
npm install --save envosman
Options for adding an rc file
handles adding conditions to source rc file from .bashrc and .profile
Parameters:
- rcOptions (
RcOptions
)
returns: Promise
Escape a string for use in a shell command
Parameters:
- valGiven (
string
) - The string to escape - shouldEscapeSpace (
boolean
) - Whether to escape spaces in the string
returns: any
The options for adding an environment variable
Add an environment variable.
This function is cross-platforms and works in all the local or CI systems.
Parameters:
- name (
string
) - valGiven (
string
) - givenOptions (
Partial<AddEnvOptions>
)
returns: Promise
The options for adding a PATH variable
Add a path to the PATH environment variable.
This function is cross-platforms and works in all the local or CI systems.
Parameters:
- path (
string
) - givenOptions (
Partial<AddPathOptions>
)
returns: Promise
You can sponsor my work here:
https://github.com/sponsors/aminya
Pull requests, issues and feature requests are welcome. See the Contributing guide.