voluptasmollitia
Version:
Monorepo for the Firebase JavaScript SDK
34 lines (19 loc) • 1.48 kB
Markdown
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) > [@firebase/storage](./storage.md) > [list](./storage.list.md)
## list() function
List items (files) and prefixes (folders) under this storage reference.
List API is only available for Firebase Rules Version 2.
GCS is a key-blob store. Firebase Storage imposes the semantic of '/' delimited folder structure. Refer to GCS's List API if you want to learn more.
To adhere to Firebase Rules's Semantics, Firebase Storage does not support objects whose paths end with "/" or contain two consecutive "/"s. Firebase Storage List API will filter these unsupported objects. list() may fail if there are too many unsupported objects in the bucket.
<b>Signature:</b>
```typescript
export declare function list(ref: StorageReference, options?: ListOptions): Promise<ListResult>;
```
## Parameters
| Parameter | Type | Description |
| --- | --- | --- |
| ref | [StorageReference](./storage.storagereference.md) | StorageReference to get list from. |
| options | [ListOptions](./storage.listoptions.md) | See ListOptions for details. |
<b>Returns:</b>
Promise<[ListResult](./storage.listresult.md)<!-- -->>
A Promise that resolves with the items and prefixes. `prefixes` contains references to sub-folders and `items` contains references to objects in this folder. `nextPageToken` can be used to get the rest of the results.