Skip to content

Latest commit

 

History

History
174 lines (102 loc) · 3.91 KB

DOCUMENTATION.md

File metadata and controls

174 lines (102 loc) · 3.91 KB

Table of Contents

filterCommentInLines

This function filters inline comments after escaped hashtag

Parameters

Returns (string | array | object) filtered value

filterCommentLines

This function filters comments at line start

Parameters

Returns array filtered value

filterEmptyLines

This function filters empty lines

Parameters

Returns array filtered value

removeQuotationMarks

This function removes quotation marks

Parameters

Returns string filtered value

parseValue

This function parsed

Parameters

Returns (object | string) value

getProcessEnv

This function parse the Global Super process.env The values in process.env will be parsed by parseValue

Returns object env

parseEnvironmentFileString

This function parse the environment file to an Object

Parameters

Returns object parsed environment variables

replaceNestedChars

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.

Parameters

Examples

replaceNestedChars('${HOME}', '${HOME}/log', { HOME: '/var/www' });

Returns string (elem|val)

processenv

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 (\#)

Parameters

  • key string?
  • defaultValue any?

Returns (string | object | array | function | undefined) value