0.2.2 • Published 4 years ago

@moontoad/s3 v0.2.2

Weekly downloads
5
License
MIT
Repository
github
Last release
4 years ago

Introduction

This package is for Amazon S3(Simple Storage Service) compatible services.

It supports Aliyun OSS(Object Storage Service), Tecent COS(Cloud Object Storage), and Sina SCS(Sina Cloud Storage).

Installation

Using npm:

npm i @moontoad/s3

Usage

const { S3 } = require('@moontoad/s3')

let cli = new S3('tecent', 'mybucket', {
	SecretId: 'xxxxxxxxxx',
	SecretKey: 'xxxxxxxxxx',
})
// this will push the all files and directories in 'local/directory' to the bucket,
// with the same directory hierarchy
cli.putDirectory('local/directory')


// different S3 services have different option names
cli = new S3('ali', 'mybucket', {
	accessKeyId: 'xxxxxxxxxx',
	accessKeySecret: 'xxxxxxxxxx',
	region: 'oss-cn-shanghai',
})
cli.putDirectory('local/directory')


cli = new S3('sina', 'mybucket', {
	accessKeyId: 'xxxxxxxxxx',
	secretAccessKey: 'xxxxxxxxxxxxxxxx',
	sslEnabled: false,
})
cli.putDirectory('local/directory')
0.2.2

4 years ago

0.2.1

5 years ago

0.2.0

5 years ago

0.1.1

5 years ago

0.1.0

5 years ago