@seneca/s3-store
v2.5.0
Published
Entity store using AWS S3.
Downloads
13
Keywords
Readme
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.
@seneca/s3-store
| | This open source module is sponsored and supported by Voxgig. | | ---------------------------------------------------- | --------------------------------------------------------------------------------------- |
Install
$ npm install @seneca/s3-store
Quick Example
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"}
More Examples
Motivation
Reference
Options
debug
: booleanprefix
: stringsuffix
: stringfolder
: anys3
: objectmap
: objectshared
: objectlocal
: objectent
: objectinit$
: boolean