@loopback/docs
Version:
Documentation files rendered at [https://loopback.io](https://loopback.io)
53 lines (36 loc) • 2.03 kB
Markdown
lang: en
title: 'API docs: core.extensions.list'
keywords: LoopBack 4.0, LoopBack 4, Node.js, TypeScript, OpenAPI
sidebar: lb4_sidebar
editurl: https://github.com/loopbackio/loopback-next/tree/master/packages/core
permalink: /doc/en/lb4/apidocs.core.extensions.list.html
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) > [@loopback/core](./core.md) > [extensions](./core.extensions.md) > [list](./core.extensions.list.md)
## extensions.list() function
Inject an array of resolved extension instances for the extension point. The list is a snapshot of registered extensions when the injection is fulfilled. Extensions added or removed afterward won't impact the list.
<b>Signature:</b>
```typescript
function list(extensionPointName?: string, metadata?: InjectionMetadata): (target: Object, member: string | undefined, methodDescriptorOrParameterIndex?: number | TypedPropertyDescriptor<any> | undefined) => void;
```
## Parameters
| Parameter | Type | Description |
| --- | --- | --- |
| extensionPointName | string | Name of the extension point. If not supplied, we use the <code>name</code> tag from the extension point binding or the class name of the extension point class. If a class needs to inject extensions from multiple extension points, use different <code>extensionPointName</code> for different types of extensions. |
| metadata | [InjectionMetadata](./context.injectionmetadata.md) | Optional injection metadata |
<b>Returns:</b>
(target: Object, member: string \| undefined, methodDescriptorOrParameterIndex?: number \| TypedPropertyDescriptor<any> \| undefined) => void
## Example
```ts
import {extensionPoint, extensions} from '@loopback/core';
@extensionPoint(GREETER_EXTENSION_POINT_NAME)
export class GreetingService {
constructor(
@extensions.list() // Inject an array of extensions for the extension point
private greeters: Greeter[],
// ...
) {
// ...
}
```