read-config-file

  • Version 6.2.0
  • Published
  • 18.8 kB
  • 5 dependencies
  • MIT license

Install

npm i read-config-file
yarn add read-config-file
pnpm add read-config-file

Overview

Read configuration file in various formats:

Index

Functions

function findAndReadConfig

findAndReadConfig: <T>(
request: ReadConfigRequest
) => Promise<ReadConfigResult<T> | null>;

    function getConfig

    getConfig: <T>(
    request: ReadConfigRequest,
    configPath?: string | null
    ) => Promise<ReadConfigResult<T> | null>;

      function loadConfig

      loadConfig: <T>(
      request: ReadConfigRequest
      ) => Promise<ReadConfigResult<T> | null>;

        function loadEnv

        loadEnv: (envFile: string) => Promise<import('dotenv').DotenvParseOutput | null>;

          function loadParentConfig

          loadParentConfig: <T>(
          request: ReadConfigRequest,
          spec: string
          ) => Promise<ReadConfigResult<T>>;

            function orIfFileNotExist

            orIfFileNotExist: <T>(promise: Promise<T>, fallbackValue: T) => Promise<T>;

              function orNullIfFileNotExist

              orNullIfFileNotExist: <T>(promise: Promise<T>) => Promise<T | null>;

                Interfaces

                interface ReadConfigRequest

                interface ReadConfigRequest {}

                  property configFilename

                  configFilename: string;

                    property packageKey

                    packageKey: string;

                      property packageMetadata

                      packageMetadata: Lazy<{
                      [key: string]: any;
                      } | null> | null;

                        property projectDir

                        projectDir: string;

                          interface ReadConfigResult

                          interface ReadConfigResult<T> {}

                            property configFile

                            readonly configFile: string | null;

                              property result

                              readonly result: T;

                                Package Files (1)

                                Dependencies (5)

                                Dev Dependencies (3)

                                Peer Dependencies (0)

                                No peer dependencies.

                                Badge

                                To add a badge like this onejsDocs.io badgeto your package's README, use the codes available below.

                                You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/read-config-file.

                                • Markdown
                                  [![jsDocs.io](https://img.shields.io/badge/jsDocs.io-reference-blue)](https://www.jsdocs.io/package/read-config-file)
                                • HTML
                                  <a href="https://www.jsdocs.io/package/read-config-file"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>