@flownet/lib-load-fnet-config
v0.2.17
Published
From an end-user perspective, **@fnet/config** is a software package developed to handle configuration files in a system. It processes and fetches configuration data from specific files located in the user's computer. The package deals with files mainly i
Downloads
53
Readme
@fnet/config
From an end-user perspective, @fnet/config is a software package developed to handle configuration files in a system. It processes and fetches configuration data from specific files located in the user's computer. The package deals with files mainly in a '.fnet' format or a '.fnet.yaml' format.
Primary Features and Functionality
Input Validation: The package receives a configuration file's name as an input. It has the option to validate if the input is a string or an array of strings and accordingly process the input.
Multi-Directories Search: If the input is valid, @fnet/config tries to find the file in several directories. These directories are based on where the process is running and the user's home directory.
Support for Multiple Extensions: Depending on the type of data you are fetching, the package checks for the file existence with multiple extensions like '.fnet' and '.fnet.yaml'. It first finds the file, then reads and parses it using the '@fnet/yaml' package.
Environment Variables Modification: If the configuration file contains an 'env' object, and if requested by the user, the package can transfer the properties of this object to the environment variables of the process.
Optional Configuration: The package also gives the user an option to decide whether the configuration file is necessary or optional. It throws an error if it fails to find a required (non-optional) file.
In short, @fnet/config delivers an efficient way to locate, read, and parse configuration files, potentially updating environment variables based on its content.