Seneca S3 Store is a plugin for Seneca
Entity store that uses AWS S3. This store can also handle JSONL documents and binary files. This plugin integrates with Seneca Gateway Lambda to support S3 events. A local mode can simulate S3 behaviour for local development and testing.
This open source module is sponsored and supported by Voxgig. |
---|
$ npm install @seneca/s3-store
const Seneca = require('seneca')
// import Seneca from 'seneca'
let seneca = Seneca()
.use('entity', { mem_store: false })
.use('s3-store', {
map: {
'foo': '*' // All 'foo' entity operations
},
// Settings shared by all S3 Operations
shared: {
Bucket: 'my-aws-bucket-name'
},
// S3 client settings
s3: {
Region: 'us-east-1'
}
})
// Saves the file foo0.json to the bucket.
seneca.entity('foo').save$({id$:'foo0', x:1})
// The file contents will be:
// {"id":"foo0","x":1,"entity$":"-/-/foo"}
debug
: booleanprefix
: stringsuffix
: stringfolder
: anys3
: objectmap
: objectshared
: objectlocal
: objectent
: objectinit$
: boolean