UNPKG

@loopback/docs

Version:

Documentation files rendered at [https://loopback.io](https://loopback.io)

37 lines (24 loc) 1.67 kB
--- lang: en title: 'API docs: context.context.getconfigasvalueorpromise' keywords: LoopBack 4.0, LoopBack 4, Node.js, TypeScript, OpenAPI sidebar: lb4_sidebar editurl: https://github.com/loopbackio/loopback-next/tree/master/packages/context permalink: /doc/en/lb4/apidocs.context.context.getconfigasvalueorpromise.html --- <!-- Do not edit this file. It is automatically generated by API Documenter. --> [Home](./index.md) &gt; [@loopback/context](./context.md) &gt; [Context](./context.context.md) &gt; [getConfigAsValueOrPromise](./context.context.getconfigasvalueorpromise.md) ## Context.getConfigAsValueOrPromise() method Get the value or promise of configuration for a given binding by key <b>Signature:</b> ```typescript getConfigAsValueOrPromise<ConfigValueType>(key: BindingAddress, propertyPath?: string, resolutionOptions?: ResolutionOptions): ValueOrPromise<ConfigValueType | undefined>; ``` ## Parameters | Parameter | Type | Description | | --- | --- | --- | | key | [BindingAddress](./context.bindingaddress.md) | Binding key | | propertyPath | string | Property path for the option. For example, <code>x.y</code> requests for <code>&lt;config&gt;.x.y</code>. If not set, the <code>&lt;config&gt;</code> object will be returned. | | resolutionOptions | [ResolutionOptions](./context.resolutionoptions.md) | Options for the resolution. - optional: if not set or set to <code>true</code>, <code>undefined</code> will be returned if no corresponding value is found. Otherwise, an error will be thrown. | <b>Returns:</b> [ValueOrPromise](./context.valueorpromise.md)<!-- -->&lt;ConfigValueType \| undefined&gt;