vmol-s3

0.2.3 • Public • Published

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)

Readme

Keywords

Package Sidebar

Install

npm i vmol-s3

Weekly Downloads

3

Version

0.2.3

License

ISC

Unpacked Size

18.9 kB

Total Files

5

Last publish

Collaborators

  • alexandre_voilab