This is an AWS s3 adapter for focaccia filesystem abstraction layer.
Execute npm install --save @focaccia/aws-adapter
into your main repo.
Uploading a file using AWS adapter
const AWS = require('aws-sdk');
const {AwsS3Adapter} = require("@focaccia/aws-adapter");
const {Focaccia} = require("@focaccia/focaccia");
AWS.config.update({
accessKeyId: 'something',
secretAccessKey: 'something',
});
var s3 = new AWS.S3();
let tAsty = new Focaccia(new AwsS3Adapter(s3, 'newBucket'), {});
// This will upload a file
let res = tAsty.write("helloworld.txt", "Hello Amazon world");
// Return a promise
res.then((d) => {
console.log("RESULT", d);
})
For more docs and reference please visit https://github.com/Focaccia/Focaccia