multer-cloud-storage-engine
TypeScript icon, indicating that this package has built-in type declarations

1.0.4 • Public • Published

multer-cloud-storage-engine

multer-cloud-storage-engine is a multer custom store engine for Google Cloud Storage service.

Installation

npm i multer-cloud-storage-engine --save

or

yarn add multer-cloud-storage-engine

SET_ENVIRONMENT_VARIABLES

GCP

GCP_PROJECT_ID =YOUR_GCP_PROJECT_ID

GCP_KEY_FILE_NAME =YOUR_JSON_KEY_FILE_PATH

GCP_BUCKET_NAME =YOUR_GCP_BUCKET_NAME

Usage

ES6

import { MulterStorageEngine, StorageType } from 'multer-cloud-storage-engine';
import express from 'express';

const app = express();

const upload = MulterStorageEngine({
    storage: StorageType.GCP,
});

app.post('/upload', upload.single('profileImage'), (req, res) => {
    console.log(req.files);
    res.json(req.files);
});

Package Sidebar

Install

npm i multer-cloud-storage-engine

Weekly Downloads

1

Version

1.0.4

License

MIT

Unpacked Size

7.68 kB

Total Files

7

Last publish

Collaborators

  • fahadashraf9624