11.2.2 • Published 3 months ago

@chunkd/fs-aws v11.2.2

Weekly downloads
-
License
MIT
Repository
github
Last release
3 months ago

@chunkd/fs-aws

File system abstraction for AWS S3 using @aws-sdk/client-s3

see @chunkd/fs for more usage

Usage

import { FsAwsS3 } from '@chunkd/fs-aws';
import S3Client from '@aws-sdk/clients-s3';

const fsS3 = new FsAwsS3(new S3Client());

// Read in the first 1KB of data

for await (const url of fsS3.list(new URL("s3://foo/bar/baz")) {
    // files
}

// Stream a file from one bucket to another
await fsS3.write(new URL("s3://foo/bar/baz.txt"), fsS3.readStream(new URL("s3://bar/baz.txt")))