Git Product home page Git Product logo

google-driver's Introduction

google-driver

WARNING: Use at your own risk. I'm still fleshing out the API for this.

Written with support for ES7 async/await in mind. Refer to test.js for example code style.

Provides a very basic API to upload files onto google drive via a constructed GoogleDriver instance.

import GoogleDriver from 'google-driver';
const googleDriver = new GoogleDrive({ CLIENT_ID, CLIENT_SECRET, REFRESH_TOKEN });

Note: Don't store your secret keys in public github! I'd strongly recommend storing them as environment variables in whatever environment you're running them on. You can obtain your keys in the following manner:

const { CLIENT_ID, CLIENT_SECRET, REFRESH_TOKEN } = process.env

API

  • upload(file, mimeType, folderId) - uploads the given file (in local filesystem) into the optionally specified folderId
  • createFolder(folderName, folderId) - creates a folder named folderName into the optionally specified folderId (as a subfolder).
  • deleteAll(title, folderId) - deletes all files named title in the optionally specified folderId
  • search(title) - returns an array of resource objects matching the given title in the optionally specified folderId

More APIs added as I go along.

notes

Unless otherwise specified:

  • If folderId is not specified, operations are assumed to take place in the root folder.
  • All non-deletion operations will return either a single resource or an array of resources.

google-driver's People

Contributors

masotime avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.