@avanio/variable-util
    Preparing search index...

    Function getConfigVariable

    • get config variable from loaders

      Type Parameters

      • Output

      Parameters

      Returns Promise<Output>

      • config variable
      // from "@avanio/variable-util-node"
      const fileEnv = new FileConfigLoader({fileName: './settings.json', type: 'json'}).getLoader;

      const port: Promise<string> = await getConfigVariable('PORT', [env(), fileEnv()], stringParser, '8080', {showValue: true});
      // with override key
      const port: Promise<string> = await getConfigVariable('PORT', [env('HTTP_PORT', fileEnv())], stringParser, '8080', {showValue: true});

      v0.2.5

    • get config variable from loaders

      Type Parameters

      • Output

      Parameters

      Returns Promise<undefined | Output>

      • config variable
      // from "@avanio/variable-util-node"
      const fileEnv = new FileConfigLoader({fileName: './settings.json', type: 'json'}).getLoader;

      const port: Promise<string> = await getConfigVariable('PORT', [env(), fileEnv()], stringParser, '8080', {showValue: true});
      // with override key
      const port: Promise<string> = await getConfigVariable('PORT', [env('HTTP_PORT', fileEnv())], stringParser, '8080', {showValue: true});

      v0.2.5