import { S3Client } from "https://dotland.deno.dev/x/s3_lite_client@0.7.0/mod.ts";
Properties
Use path-style requests, e.g. https://endpoint/bucket/object-key instead of https://bucket/object-key
Methods
Common code used for both "normal" requests and presigned UTL requests
Calculate part size given the object size. Part size will be at least this.partSize.
Per https://docs.aws.amazon.com/AmazonS3/latest/userguide/qfacts.html we have to stick to the following rules:
- part size between 5MB (this.maximumPartSize) and 5GB (this.maxObjectSize) (the final part can be smaller than 5MB however)
- maximum of 10,000 parts per upload
- maximum object size of 5TB
Copy an object into this bucket
Delete a single object.
You can also pass a versionId to delete a specific version of an object.
Check if an object with the specified key exists.
Get an object.
Returns a standard HTTP Response object, which has many ways of consuming the response including
.text()
, .json()
, .body
(ReadableStream), .arrayBuffer()
, and .blob()
.
Stream a partial object, starting from the specified offset in bytes, up to the specified length in bytes. A length of zero will return the rest of the object from the specified offset. Pass a version UUID as "versionId" to download a specific version.
Returns a standard HTTP Response object.
Low-level method to generate a pre-signed URL.
List objects in the bucket, optionally filtered by the given key prefix.
This returns a flat list; use listObjectsGrouped() for more advanced behavior.
List objects in the bucket, grouped based on the specified "delimiter".
See https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-prefixes.html
Make a single request to S3
Generate a pre-signed GET request URL.
Use options.expirySeconds to override the expiration time (default is 7 days)
Get detailed information about an object.