@textile/hub > Buckets > list
Buckets.list() method
Returns a list of all bucket roots.
Signature:
list(): Promise<Root[]>;
Returns:
Promise<Root[]>
Example
Find an existing Bucket named "app-name-files"
import { Buckets } from '@textile/hub'
const exists = async (buckets: Buckets) => {
const roots = await buckets.list();
return roots.find((bucket) => bucket.name === "app-name-files")
}
`