List and Search

You can list files and apply filters. The returned list is paginated.

import { f0 } from 'file0';

// List first 100 files
const { files, cursor, hasMore } = await f0.list();

// List the second 100 files
if (hasMore) {
  const { files, cursor, hasMore } = await f0.list({ cursor });
}

// List the first 1000 files
const { files, cursor, hasMore } = await f0.list({ limit: 1000 });

// List files that's name starts with 'user123/'
// and ends with '.png'
// and contains 'profile'
const files = await f0.list({
  endsWith: '.png', 
  startsWith: 'user123/',
  contains: 'profile'
});

Last updated