Skip to content

Commit

Permalink
update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
c4spar committed Nov 11, 2021
1 parent ac41170 commit 80765cf
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,22 @@ Amazon S3 for Deno
```ts
import { S3, S3Bucket } from "https://deno.land/x/[email protected]/mod.ts";

// Create a new bucket.
// Create a S3 instance.
const s3 = new S3({
accessKeyID: Deno.env.get("AWS_ACCESS_KEY_ID")!,
secretKey: Deno.env.get("AWS_SECRET_ACCESS_KEY")!,
region: "us-east-1",
endpointURL: Deno.env.get("S3_ENDPOINT_URL"),
});

const myBucket = await s3.createBucket("my-bucket", { acl: "private" });
// Create a new bucket.
let bucket = await s3.createBucket("test", { acl: "private" });

// Get an existing bucket.
bucket = s3.getBucket("test");

// Create a bucket instance from an existing bucket.
const bucket = new S3Bucket({
// Create a bucket instance manuely.
bucket = new S3Bucket({
accessKeyID: Deno.env.get("AWS_ACCESS_KEY_ID")!,
secretKey: Deno.env.get("AWS_SECRET_ACCESS_KEY")!,
bucket: "test",
Expand Down

0 comments on commit 80765cf

Please sign in to comment.