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

node-gdrive

Package Overview
Dependencies
Maintainers
1
Versions
20
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

node-gdrive

Google driver for node

  • 0.0.15
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
3
Maintainers
1
Weekly downloads
 
Created
Source

node-gdrive

Upload file to google drive

Installation

With npm do:

npm install node-gdrive

Use command line global:

npm install node-gdrive -g

Config

gdrive token:get # generator new token

Usage

Node project

// upload file

const Drive = require("node-gdrive");

let filePath = 'foo.txt';

var upload = Drive.upload(filePath, {share: true});
upload.on('*', (event, data) => {
  console.log(event, data);
});

// Download file
let fileId = "1eoAgH8xgBkkUDXkTdyPSHSbaJViv33oX";

Drive
  .download(fileId, {
    resumable: true, // Resume download session
    force: false, // Override file if exists
    output: './tmp/', // Dir or filepath to save file
  })
  .then(file => {
    console.log("file", file);
  })
  .catch(err => {
    console.error("err", err);
  });

Commands line
gdrive upload file.txt --share user@gmail.com # upload and share file

gdrive donwload 1eoAgH8xgBkkUDXkTdyPSHSbaJViv33oX # download file

gdrive --help

License

MIT

Keywords

FAQs

Package last updated on 09 Feb 2020

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