distack

1.0.2 • Public • Published

Distributed Storage Stack

NPM version

Read and write to multiple storage systems through one simple API. All read / writes are streamed so large files are no problem. Currently supports serial and parallel writes to:

  • Amazon S3
  • Local disk

Installation

npm install distack

Quick Start

var DSS = require('distack');
 
// init
var store = new DSS([
    {
        'tag' : 'local',
        'type': 'Disk',
        'cfg' : {...}
    },
    {
        'tag' : 'cloud',
        'type': 'S3',
        'cfg' : {...}
    }
]);
 
// write
store.write(['local', 'cloud'], 'myKey', 'my/file', function (err) {...});
 
// read
try {
  var readStream = store.read('local', 'myKey');
} catch(e) {...}

Storage services

Amazon S3

var store = new DSS([
    {
        'tag' : 'cloud',
        'type': 'S3',
        'cfg' : {
            'key'   : '<ACCESS_KEY>',
            'secret': '<SECRET>',
            'region': '<REGION>1',
            'bucket': '<BUCKET_NAME>'
        }
    }
]);

Local Disk Storage

var store = new DSS([
    {
        'tag' : 'local',
        'type': 'Disk',
        'cfg' : {
            'basedir': './uploads'
        }
    }
]);

License

MIT

Package Sidebar

Install

npm i distack

Weekly Downloads

0

Version

1.0.2

License

MIT

Last publish

Collaborators

  • ramniquesingh