Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@machinshin/multer-gcs

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@machinshin/multer-gcs

Streaming multer storage engine for Google Cloud Storage

  • 1.0.4
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Weekly downloads
 
Created
Source

Multer-Storage-GCS

Google Cloud Storage Multer Storage Engine

Multer Storage Engine that uses Google Cloud Storage as a storage system.

Please read official documentation at https://googlecloudplatform.github.io/gcloud-node/#/docs/v0.36.0/storage for additional options

Installation

npm install multer-gcs

Usage

var multer = require( 'multer' );
var gcs = require( 'multer-gcs' );
var storage = gcs({
	filename    : function( req, file, cb ) {
		cb(null, file.fieldname + '-' + Date.now());
	},
	bucket:       'bucket-name', // Required : bucket name to upload
	projectId:       'dummy-project', // Required : Google project ID
	keyFilename:  '/path/to/keyfile.json', // Required : JSON credentials file for Google Cloud Storage
	acl:  'publicRead' // Optional : Defaults to projectPrivate. See options in the link below:
  	//https://cloud.google.com/storage/docs/access-control/lists
});

var gcsUpload = multer({ storage: storage });

app.post( '/upload', gcsUpload.single( 'file' ), function( req, res, next ) {

	res.send( 'File was uploaded successfully!' );

});

You can also use environment variables for multer-gcs parameters.

GCS_BUCKET='bucket-name'
GCLOUD_PROJECT='dummy-project'
GCS_KEYFILE='/path/to/keyfile.json'

License

MIT

Keywords

FAQs

Package last updated on 29 Sep 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc