@litejs/s3

24.1.0 • Public • Published

LiteJS S3 – Coverage Size Buy Me A Tea

Minimal S3 client for places, where full SDK functionality is not needed.

  • No dependencies

Usage

var S3 = require("@litejs/s3")
, s3client = new S3({ accessId: ID, secret: SECRET, region: "us-east-2", endpoint: "BUCKET.s3.us-east-2.amazonaws.com" })

// More examples
, awsDeprecatedPathStyle = new S3({ region: AWS_REGION, accessId: ID, secret: SECRET, bucket: AWS_BUCKET })
, googleCloudStorage = new S3({ accessId: ID, secret: SECRET, region: "auto", endpoint: "storage.googleapis.com" })
, cloudflareR2 = new S3({ accessId: ID, secret: SECRET, region: "auto", endpoint: "MY-ID.r2.cloudflarestorage.com" })


// Use with await
var data = await s3client.get("test/hello.txt")

// .. or with callback
s3client.get("test/hello.txt", function(err, data) {
	console.log("Got file", data)
})

// bucket exists
s3client.stat("test/")
s3client.list("test/")
s3client.stat("test/hello.txt")
s3client.get("test/hello.txt")
s3client.del("test/hello.txt")

Copyright (c) 2022-2024 Lauri Rooden <lauri@rooden.ee>
MIT License | GitHub repo | npm package | Buy Me A Tea

Readme

Keywords

Package Sidebar

Install

npm i @litejs/s3

Weekly Downloads

15

Version

24.1.0

License

MIT

Unpacked Size

7.38 kB

Total Files

3

Last publish

Collaborators

  • lauriro