Skip to content

List S3 objects

Lists one bounded page of objects from an S3-compatible connection.

@lainstack/s3/list-objects · Object storage

List S3 objects returns one page of object keys and sizes from an S3-compatible connection. Use it to find keys, then pass a key to @lainstack/s3/read-object, @lainstack/s3/write-object or @lainstack/s3/delete-object. It does not return file contents.

Traps:

  • There is no cursor and no way to ask for the next page. A page holds at most 100 objects (limit, default 50). When truncated is true, more objects exist that you cannot reach. Narrow the prefix to see them.
  • objects is an inline list of key and size only. There is no modified date and no content type.
  • The prefix is relative to the connection’s configured prefix. A prefix cannot start with http://, https://, s3:// or arn:.
  • bucket is optional. Set it only when the connection does not already select one.
  • An empty objects list is a normal result, not an error.
Setting Key Type Details
S3-compatible connection (required) credentialId Connection Uses the selected S3-compatible object-storage connection. At most 255 characters.
Bucket bucket Text Optional exact bucket when the connection does not already select one. Keys are relative to the configured connection prefix.
Prefix prefix Text Optional relative object-key prefix.
Maximum objects (required) limit Number Returns one bounded page of up to 100 objects.
Output Path Type
Objects objects List
Truncated truncated Yes or no