function AWSS3SyncAdapterError (message) {
      this.name = 'AWSS3SyncAdapterError';
      this.message = (message || '');
    }
LokiJS AWSS3SyncAdapter
@author Simon Hutchison <https://github.com/hutch120>

A remote sync adapter for LokiJS to AWS S3

Basic usage:

   const AWS = require('aws-sdk')
   const Loki = require('lokijs')
   const AWSS3SyncAdapter = require('./aws-s3-sync-adapter.js')
   var db

   var _init = function () {
     const options = {
       'AWS': AWS,
       'accessKeyId': process.env.accessKeyId, // Avoid hardcoding credentials
       'secretAccessKey': process.env.secretAccessKey, // Avoid hardcoding credentials
       'bucket': '...'
     }
     const adapter = new AWSS3SyncAdapter(options);
     db = new Loki('somefile.json', {
       autoload: false,
       autosave: true,
       adapter: adapter
     })
   }

   var _save = function () {
     db.saveDatabase(function (err, data) {
       if (err) {
         console.log(err)
         process.exit()
       } else {
         console.log('DB saved to AWS S3')
         _load() // Now attempt to load it back.
       }
     })
   }

   var _load = function () {
     db.loadDatabase({}, function (err) {
       if (err) {
         console.log(err)
         process.exit()
       } else {
         console.log('DB loaded from AWS S3')
         process.exit()
       }
     })
   }

   _init()
   _save()