Skip to content
This repository has been archived by the owner on Nov 6, 2022. It is now read-only.

Latest commit

 

History

History
34 lines (31 loc) · 1.32 KB

README.md

File metadata and controls

34 lines (31 loc) · 1.32 KB

npm package Build Status Code style Dependencies DevDependencies codecov

Usage

yarn add @toba/google-drive
const config: ClientConfig = {
   apiKey: process.env['GOOGLE_DRIVE_KEY'],
   folderID: 'some folder ID',
   useCache: false,
   cacheSize: 0,
   auth: {
      clientID: process.env['GOOGLE_CLIENT_ID'],
      secret: process.env['GOOGLE_SECRET'],
      callback: 'http://localhost/auth/google',
      token: {
         type: null,
         access: process.env['GOOGLE_ACCESS_TOKEN'],
         accessExpiration: null as Date,
         refresh: process.env['GOOGLE_REFRESH_TOKEN']
      }
   } as AuthConfig
};
const client = new Client(config);
const text = await client.readFileWithName('myfile.txt');