Big update!Introducing GitHub Bot Commands. Learn more
Socket
Log inBook a demo

multer-sharp-minio-storage

Package Overview
Dependencies
1
Maintainers
1
Versions
2
Issues
File Explorer

Advanced tools

multer-sharp-minio-storage

Streaming multer storage engine with Sharp image transformer for MinIO.

    0.0.1unpublished

Version published
Maintainers
1

Readme

Source

multer-sharp-minio-storage

Streaming multer storage engine with Sharp image transformer for MinIO.

Installation

npm install [email protected]

Usage

import multer from 'multer' import path from 'path' import sharp from 'sharp' import slugify from 'slugify' import MulterSharpMinioStorage from 'multer-sharp-minio-storage' const upload = multer({ storage: new MulterSharpMinioStorage({ filename: (_req, file, t) => { const name = path.parse(file.originalname).name return slugify(name, { lower: true, trim: true }) + '_' + Date.now() + '_' + t.id + '.jpg' }, meta: (_req, _file, _t) => ({ 'Content-Type': 'image/jpeg' }), bucket: process.env.S3_BUCKET, transformers: [ { id: '320', sharp: sharp().resize(320).jpeg() }, { id: '640', sharp: sharp().resize(640).jpeg() } ], clientOptions: { endPoint: process.env.S3_ENDPOINT, accessKey: process.env.S3_ACCESS_KEY_ID, secretKey: process.env.S3_SECRET_ACCESS_KEY } }) }) export const uploadImage = upload.single('file')

Keywords

FAQs

What is multer-sharp-minio-storage?

security holding package

Is multer-sharp-minio-storage well maintained?

We found that multer-sharp-minio-storage demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago.It has 1 open source maintainer collaborating on the project.

Last updated on 01 Nov 2022

Did you know?

Socket installs a Github app to automatically flag issues on every pull request and report the health of your dependencies. Find out what is inside your node modules and prevent malicious activity before you update the dependencies.

Install Socket
Socket

Product

Subscribe to our newsletter

Get open source security insights delivered straight into your inbox. Be the first to learn about new features and product updates.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc