0.0.4 • Published 5 years ago

filehook-sharp v0.0.4

Weekly downloads
2
License
MIT
Repository
github
Last release
5 years ago

Filehook Sharp

A Node.js express middleware for filehook library.

Installation

npm install filehook-sharp --save

Usage

import { useFilehookStyles, Options } from './filehook-sharp';

...

const options: Options = {
    styles: {
        xsmall: {
            width: 300
        },

        small: {
            width: 768
        },

        medium: {
            width: 1024,
            height: 768
        },

        'medium-blurred': {
            width: 1024,
            transform: (transformer: Sharp) => { return transformer.blur(10); }
        },
    },
    rootPath: '../../blobs'
};

...

const server = express();
server.get('/filehook/:style/:filename', useFilehookStyles(options));