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

    Function getConfigObject

    • get config object which contains value and type of loader

      Type Parameters

      • Output

      Parameters

      Returns Promise<LoaderTypeValueStrict<Output>>

      config object

      // from "@avanio/variable-util-node"
      const fileEnv = new FileConfigLoader({fileName: './settings.json', type: 'json'}).getLoader;
      const portConfig: {type: string | undefined; value: string} = await getConfigObject('PORT', [env(), fileEnv()], stringParser, '8080', {showValue: true});
      const value: string = portConfig.value;
      const type: string | undefined = portConfig.type; // loader type name

      v0.2.5

    • get config object which contains value and type of loader

      Type Parameters

      • Output

      Parameters

      Returns Promise<LoaderTypeValue<Output>>

      config object

      // from "@avanio/variable-util-node"
      const fileEnv = new FileConfigLoader({fileName: './settings.json', type: 'json'}).getLoader;
      const portConfig: {type: string | undefined; value: string} = await getConfigObject('PORT', [env(), fileEnv()], stringParser, '8080', {showValue: true});
      const value: string = portConfig.value;
      const type: string | undefined = portConfig.type; // loader type name

      v0.2.5