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

selfish-google-drive

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

selfish-google-drive

Google drive api for that access your own account

  • 1.0.4
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
8
increased by300%
Maintainers
1
Weekly downloads
 
Created
Source

selfish-google-drive


Google drive api wrapper that access your own account

Installation

npm install selfish-google-drive --save

Usage

If you use the api for the first time, it will generate sgd-token.json (recommended to add it to .gitignore). Everytime you use the api, It will read the json file instead of call the api again to get the token, it will call the google api again if the sgd-token.json expired (expired in 3600s) or invalid.

The sgd-token.json should be like this

{
  "access_token": "somestring",
  "token_type": "Bearer",
  "expires_in": 3600
}

To init the package you should provide credential like below from google.

const credential = {
  clientID: 'somestring',
  clientSecret: 'somestring',
  refreshToken: 'somestring'
}

You can check how to generate the credential at How do I authorise an app (web or installed) without user intervention?

1. mkdir

Create folder at your google drive

return sgd.mkdir('HADOKE1N').then(console.log)

// Example return object
// { kind: 'drive#file',
//   id: '1rKARa_6zPZPPp4s5_ruOaxZLX6p3aIaE',
//   name: 'HADOKE1N',
//   mimeType: 'application/vnd.google-apps.folder' }

Keywords

FAQs

Package last updated on 05 Mar 2018

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