New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

google-cloud-directory-upload

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

google-cloud-directory-upload

To upload files and folder from a local directory to google cloud storage bucket.

latest
Source
npmnpm
Version
0.0.6
Version published
Maintainers
1
Created
Source

Upload Directory To Google Cloud Bucket

npm Support Node of LTS

To upload files and folder from a directory to google cloud bucket.

Installation

$ npm install google-cloud-directory-upload

Usage

var uploadDirectory = require("google-cloud-directory-upload");

Upload Directory To Google Cloud Bucket Example

// options
const options = {
  bucketName: "bucketName", // Google Cloud bucket name
  keyFilename: "../../keys.json", // Bucket configuration key file path
  directoryPath: "../../tests/reports/mochareports", // Directory to upload
  bucketPath: "report", // optional, Unique bucket folder name
  metaData: { // optional
    predefinedAcl: "publicRead",
  },
};

// request
(async () => {
  console.log(await uploadDirectory(options)); // returns <response_data>
})();

// response
{
  status: 200,
  files: '7 files uploaded successfully',
  fileList: [
    '/tests/reports/mochareports/assets/app.css',
    '/tests/reports/mochareports/assets/app.css.map',
    '/tests/reports/mochareports/assets/app.js',
    '/tests/reports/mochareports/assets/app.js.LICENSE.txt',
    '/tests/reports/mochareports/assets/app.js.map',
    '/tests/reports/mochareports/assets/MaterialIcons-Regular.woff',
    '/tests/reports/mochareports/assets/MaterialIcons-Regular.woff2',
  ],
  bucketUrl: 'https://storage.googleapis.com/{bucketName}/{bucketPath}'
}

For more google cloud storage options follow Google Cloud Storage.

License

MIT license.

Copyright © 2021. S.Gupta

Keywords

google cloud storage

FAQs

Package last updated on 07 Jan 2022

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