1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
import process from "node:process";
export const downloadTextFromS3 = (async () => {
const { S3Client } = await import(
"https://deno.land/x/s3_lite_client@0.6.1/mod.ts"
);
const s3client = new S3Client({
endPoint: "s3.amazonaws.com",
region: process.env.awsS3Region,
bucket: process.env.awsS3Bucket,
accessKey: process.env.awsS3Key,
secretKey: process.env.awsS3Secret,
});
const res = await s3client.getObject("filename.txt");
return await res.text();
})();
Val Town is a social website to write and deploy JavaScript.
Build APIs and schedule functions from your browser.
Comments
Nobody has commented on this val yet: be the first!
October 23, 2023