0.1.2 • Published 7 years ago

ying-s3 v0.1.2

Weekly downloads
1
License
MIT
Repository
-
Last release
7 years ago

Node JS Amazon S3 Client

Features

  • Uploading file
  • Downloading file

Synopsis

S3 awsConfig.json

{
  "accessKeyId":"AKIAIK5LJ4J3WCS2Q",
  "secretAccessKey": "nkuZX389mIXCgN0hl4JKX8gJRzEYxH",
  "region":"ap-southeast-1",
  "maxRetries": 3,
  "s3" : {
		"params": {
      "Bucket": "ying-photos"
    },
    "app" : {
      "uploadTimeout":3000000,
      "downloadTimeout": 3000000
    }
	}
}

Uploading from local file system to s3

var awsConfig = require('./awsconfig');

var s3 = require('ying-s3')(awsConfig);
...
s3.uploads3(id, localPath).then(saveData => {

Downloading from s3 to local file system

var awsConfig = require('./awsconfig');
var s3 = require('ying-s3')(awsConfig);
...
s3.downloads3(id, path).then(saveData => {