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

google-drive-io

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

google-drive-io

Library that makes file access in Google Drive easy

latest
npmnpm
Version
2.0.3
Version published
Weekly downloads
11
57.14%
Maintainers
1
Weekly downloads
 
Created
Source

google-drive-io

Node.js library that makes file access in Google Drive easy.

Abstract

The official Google Drive API requires fetching of files by their id. This is particular problematic when manipulating files/folders with directory structures (as recursion is often required). This library provides convenience methods that can retrieve / insert files based on their paths.

Methods

This library exposes a number of utility methods that aid file IO in Google Drive:

  • getFolder (folderPath, returnFields, auth)

    Attempts to fetch a google drive folder with path specified.
    Returns Google Drive file resource object if exists, otherwise err via callback(err, folder).
    @param  folderPath folder path to search for
    @param  returnFields fields in Google file resource to return (comma separated)
    @param  auth OAuth2 client for accessing user's Google Drive
    @returns the Google Drive folder resource object
    
  • getRootFolder (returnFields, auth)

    Attempts to fetch the root directory in google drive.
    Returns Google Drive file resource object if exists, otherwise err via callback(err, folder).
    @param  returnFields fields in Google file resource to return (comma separated)
    @param  auth OAuth2 client for accessing user's Google Drive
    @returns the Google Drive file resource object
    
  • getFile(filePath, returnFields, auth)

    Attempts to fetch a google drive file with path specified.
    Returns Google Drive file resource object if exists, otherwise err via callback(err, folder).
    @param  filePath file path to search for
    @param  returnFields fields in Google file resource to return (comma separated)
    @param  auth OAuth2 client for accessing user's Google Drive
    @returns the Google Drive folder resource object
    
  • createFolder(folderPath, returnFields, auth)

    Creates a google drive folder with path specified.
    @param  folderPath folder path to search for / create if not exists
    @param  returnFields fields in Google file resource to return (comma separated)
    @param  auth OAuth2 client for accessing user's Google Drive
    @returns the Google Drive folder resource object
    
  • createFolderIfNotExists(folderPath, returnFields, auth)

    See documentation for `createFolder`.
    
  • uploadFile(filePath, uploadPath, returnFields, auth)

    Upload a file to google drive.
    @param  filePath path to local file object
    @param  uploadPath path to upload to in Google Drive
    @param  returnFields fields in Google file resource to return (comma separated)
    @param  auth OAuth2 client for accessing user's Google Drive
    @returns the Google Drive file resource object of the uploaded file
    
  • uploadFileIfNotExists(filePath, uploadPath, returnFields, auth)

    See documentation for `uploadFile`.
    

FAQs

Package last updated on 14 May 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