Get object in bucket as text
One script reply has been approved by the moderators Verified
Created by admin 1254 days ago Picked 38 times
Submitted by yassinsiouda74165 Deno
Verified 259 days ago
1
import { S3Client } from "https://deno.land/x/[email protected]/mod.ts";
2

3
type S3 = {
4
  endPoint: string;
5
  port: number;
6
  useSSL: boolean;
7
  pathStyle: boolean;
8
  bucket: string;
9
  accessKey: string;
10
  secretKey: string;
11
  region: string;
12
};
13
export async function main(s3: S3, path: string) {
14
  return (await new S3Client(s3).getObject(path)).text();
15
}
16

Other submissions