0.2.3 • Published 5 years ago

vmol-s3 v0.2.3

Weekly downloads
-
License
ISC
Repository
bitbucket
Last release
5 years ago

vmol-s3

Moleculer mixin adding s3 access to the local service.

Configuration

Settings can be provided by the service or using enviroment variables.

    settings: {
        s3: {
            keyId: process.env.S3_STORAGE_KEYID,
            key: process.env.S3_STORAGE_KEY,
            region: process.env.S3_STORAGE_REGION,
            endpoint: process.env.S3_STORAGE_ENDPOINT,
            container: process.env.S3_STORAGE_CONTAINER,
            delimiter: process.env.S3_STORAGE_DELIMITER
        }
    }

Usage

To enable, add the middleware to your services.

const S3Service = require('vmol-s3');

module.exports = {
    name: 'myservice',

    /**
     * Mixins
     */
    mixins: [ S3Service ],
};

API

s3upload(stream, options)

s3uploadFromRequest(req, options)

s3stat(name)

s3getStream(name)

s3streamToKoa(ctx, name, options)

s3move(source, destination)

s3copy(source, destination)

s3remove(name)

s3withStaticUrl(prefix, data, fields)

0.2.3

5 years ago

0.2.2

5 years ago

0.1.0

5 years ago