Hub JS Package

Hub JS Package

  • Users
  • Buckets
  • Threads
  • Textile Docs

›Buckets

Buckets

  • Buckets.copyAuth() method
  • Buckets.withUserAuth() method
  • Buckets.withKeyInfo() method
  • Buckets.getToken() method
  • Buckets.getTokenChallenge() method
  • Buckets.setToken() method
  • Buckets.withThread() method
  • Buckets.getOrCreate() method
  • Buckets.create() method
  • Buckets.existing() method
  • Buckets.root() method
  • Buckets.links() method
  • Buckets.list() method
  • Buckets.listPath() method
  • Buckets.listPathFlat() method
  • Buckets.listIpfsPath() method
  • Buckets.movePath() method
  • Buckets.open() method
  • Buckets.pushPath() method
  • Buckets.pushPaths() method
  • Buckets.pushPathAccessRoles() method
  • Buckets.pullPath() method
  • Buckets.pullPathAccessRoles() method
  • Buckets.pullIpfsPath() method
  • Buckets.remove() method
  • Buckets.removePath() method
  • Buckets.setPath() method

Experimental

  • Archive interface
  • ArchiveDealInfo interface
  • ArchiveStatus enum

Types

  • GetOrCreateOptions interface
  • GetOrCreateResponse interface
  • CreateOptions interface
  • CreateResponse interface
  • Links interface
  • Path interface
  • PathAccessRole enum
  • PathItem interface
  • Root interface
  • BuckMetadata interface

@textile/hub > Buckets > listPathFlat

Buckets.listPathFlat() method

listPathRecursive returns a nested object of all paths (and info) in a bucket

Signature:

listPathFlat(key: string, path: string, dirs?: boolean, depth?: number): Promise<Array<string>>;

Parameters

ParameterTypeDescription
keystringUnique (IPNS compatible) identifier key for a bucket.
pathstringA file/object (sub)-path within a bucket.
dirsboolean(optional) if false will include only file paths
depthnumber(optional) will walk the entire bucket to target depth (default = 1)

Returns:

Promise<Array<string>>

Example

import { Buckets } from '@textile/hub'

async function printPaths(buckets: Buckets, bucketKey: string) {
  const list = await buckets.listPathFlat(bucketKey, '')
  console.log(list)
}
// [
//   '.textileseed',
//   'dir1',
//   'dir1/file1.jpg',
//   'path',
//   'path/to',
//   'path/to/file2.jpg'
// ]

← Buckets.listPath() methodBuckets.listIpfsPath() method →
  • Buckets.listPathFlat() method
  • Parameters
  • Example
Hub JS Package
Docs
Getting StartedThreadDBBuckets
Resources
All DocumentationProject SlackBlog
More
GitHubStar
Follow @textileio