- filterCommentInLines
- filterCommentLines
- filterEmptyLines
- removeQuotationMarks
- parseValue
- getProcessEnv
- parseEnvironmentFileString
- replaceNestedChars
- processenv
This function filters inline comments after escaped hashtag
Returns (string | array | object) filtered value
This function filters comments at line start
array
array
Returns array filtered value
This function filters empty lines
array
array
Returns array filtered value
This function removes quotation marks
string
string
Returns string filtered value
This function parsed
Returns (object | string) value
This function parse the Global Super process.env The values in process.env will be parsed by parseValue
Returns object env
This function parse the environment file to an Object
environmentString
string
Returns object parsed environment variables
This function parsed nested environment key/value pairs
If the nested element (elem) is present in the environment object (env), this will be parsed and returned as value (val). If the key is not present, the element (elem) is returned as a whole.
replaceNestedChars('${HOME}', '${HOME}/log', { HOME: '/var/www' });
Returns string (elem|val)
With processenv2 you have the opportunity to use environment variables directly in your project. You can parse .env files and add them to the global variables process.env. You can also specify default values with processenv2. These values are used if there is no environment variable. This makes it easier to check for errors and use standard configurations.
You also have the option to define nested variables, arrays and objects in the environment file You can use inline comments and masked hashtags (\#)
key
string?defaultValue
any?
Returns (string | object | array | function | undefined) value