Gathering detailed insights and metrics for multer-google-storage
Gathering detailed insights and metrics for multer-google-storage
Gathering detailed insights and metrics for multer-google-storage
Gathering detailed insights and metrics for multer-google-storage
multer-cloud-storage
Multer storage engine for Google Cloud Storage
@tshio/multer-google-storage
Streaming multer storage engine for Google Cloud Storage
@igorivaniuk/multer-google-storage
Streaming multer storage engine for Google Cloud Storage
beez-multer-google-storage
Streaming multer storage engine for Google Cloud Storage
Multer storage engine implementation that allows the easy uploading of files to google storage
npm install multer-google-storage
Typescript
Module System
Node Version
NPM Version
TypeScript (89.13%)
Pug (10.87%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
49 Stars
30 Commits
60 Forks
3 Watchers
18 Branches
6 Contributors
Updated on Mar 07, 2024
Latest Version
1.3.0
Package Id
multer-google-storage@1.3.0
Unpacked Size
204.28 kB
Size
43.04 kB
File Count
14
NPM Version
4.2.0
Node Version
7.10.1
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
This is a multer storage engine for google's file storage.
npm install multer-google-storage --save
or
yarn add multer-google-storage
import * as multer from 'multer';
import * as express from 'express';
import MulterGoogleCloudStorage from 'multer-google-storage';
const app = express();
const uploadHandler = multer({
storage: new MulterGoogleCloudStorage()
});
app.post('/upload', uploadHandler.any(), (req, res) => {
console.log(req.files);
res.json(req.files);
});
var multer = require("multer");
var express = require("express");
var multerGoogleStorage = require("multer-google-storage");
var app = express();
var uploadHandler = multer({
storage: multerGoogleStorage.storageEngine()
});
app.post('/upload', uploadHandler.any(), function (req, res) {
console.log(req.files);
res.json(req.files);
});
NB: This package is written to work with es5 or higher. If you have an editor or IDE that can understand d.ts (typescript) type definitions you will get additional support from your tooling though you do not need to be using typescript to use this package.
For instructions on how to create a storage bucket see the following documentation from google.
For instructions on how to obtain the JSON keyfile as well a "projectId" (contained in the key file) please refer to the following documentation from google
If using the MulterGoogleCloudStorage class without passing in any configuration options then the following environment variables will need to be set:
The constructor of the MulterGoogleCloudStorage class can be passed an optional configuration object.
Parameter Name | Type | Sample Value |
---|---|---|
autoRetry | boolean | true |
email | string | "test@test.com" |
keyFilename | string | "./key.json" |
maxRetries | number | 2 |
projectId | string | "test-prj-1234" |
filename | function | (request, file, callback): void |
bucket | string | "mybucketname" |
contentType | function | (request, file): string |
If you need to customize the naming of files then you are able to provide a function that will be called before uploading the file. The third argument of the function must be a standard node callback so pass any error in the first argument (or null on sucess) and the string name of the file on success.
getFilename(req, file, cb) {
cb(null,`${uuid()}_${file.originalname}`);
}
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
Found 4/29 approved changesets -- score normalized to 1
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
license file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Reason
123 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-07-07
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More