egg-aws-s3
Install
$ npm i egg-aws-s3 --save
Usage
exports.awsS3 = {
enable: true,
package: 'egg-aws-s3',
};
Configuration
exports.awsS3 = {
client: {
convertAsync: true,
sslEnabled: false,
s3ForcePathStyle: true,
signatureVersion: 'v2',
},
app: true,
agent: false,
};
see aws document contructor property for more client detail.
Example
app.awsS3.listBuckets({}, (err, data) => {
if (err)
console.log(err);
console.log(data);
});
try {
const data = await app.awsS3.listBucketsAsync({});
console.log(data);
} catch (err) {
console.log(err);
}
see aws document method summary for APIs.
Questions & Suggestions
Please open an issue here.
License
MIT