# FUNCTION LIST

> List details about the registered libraries and functions.

## Arguments

<ParamField body="options" type="Object">
  The list options.
  <Expandable>
    <ParamField body="libraryName" type="string">
      Pattern for matching library names.
    </ParamField>
    <ParamField body="withCode" type="boolean" default="false">
      Whether to include the library source code in the response.
    </ParamField>
  </Expandable>
</ParamField>

## Response

<ResponseField type="Object[]" required>
  List of libraries.
  <Expandable>
    <ResponseField name="libraryName" type="string" required>
      The name of the library.
    </ResponseField>
    <ResponseField name="engine" type="string" required>
      The engine used by the library (e.g., "LUA").
    </ResponseField>
    <ResponseField name="functions" type="Object[]" required>
      List of functions in the library.
      <Expandable>
        <ResponseField name="name" type="string" required>
          The name of the function.
        </ResponseField>
        <ResponseField name="description" type="string | undefined" required>
          The description of the function, or undefined if not provided.
        </ResponseField>
        <ResponseField name="flags" type="string[]" required>
          List of flags for the function (e.g., "no-writes").
        </ResponseField>
      </Expandable>
    </ResponseField>
    <ResponseField name="libraryCode" type="string">
      The source code of the library (only included if `withCode` is true).
    </ResponseField>
  </Expandable>
</ResponseField>

<RequestExample>
```ts Example
const libs = await redis.functions.list({
    libraryName: "mylib",
    withCode: true
})

console.log(libs)
// [
//   {
//     libraryName: "mylib",
//     engine: "LUA",
//     functions: [{
//       name: "my_func",
//       description: null,
//       flags: [ "no-writes" ]
//     }],
//     libraryCode: "#!lua name=mylib ..."
//   }
// ]
```
</RequestExample>
