1.0.0 • Published 8 months ago

@zvs001/s3-utils v1.0.0

Weekly downloads
1
License
ISC
Repository
github
Last release
8 months ago

Library provides additional useful methods, that doesn't exists in aws-sdk

npm

Getting Started

yarn: yarn add @zvs001/s3-utils

npm: npm i -S @zvs001/s3-utils

Note: in case you want to work with aws-sdk v2, you should use v0.1.0

import s3Utils from '@zvs001/s3-utils'
import { S3Client } from '@aws-sdk/client-s3'

const s3Client = new S3Client()

s3Utils.deleteDir(s3Client, { ... })

API

s3DeleteDir

Delete bucket directory with all containing files inside.

import s3Utils from '@zvs001/s3-utils'
// import { s3DeleteDir } from '@zvs001/s3-utils' // named import

await s3Utils.deleteDir(s3Client, {
  Bucket: 'my-bucket',
  Prefix: `folder/`,
})

s3SyncDir

Upload local directory to s3 bucket. It will upload recursively all files and directories.

import s3Utils from '@zvs001/s3-utils'
// import { s3SyncDir } from '@zvs001/s3-utils' // named import

const localDir = '/tmp/folder/'
await s3Utils.syncDir(s3Client, localDir, { bucket: 'bucket', bucketPath: 'sub-dir/' })
1.0.0

8 months ago

1.0.0-rc.1

8 months ago

0.1.0

3 years ago

0.0.1

4 years ago