1.5.0 • Published 2 years ago

@flysystem-ts/google-drive-adapter v1.5.0

Weekly downloads
-
License
ISC
Repository
github
Last release
2 years ago

@flysystem-ts/google-drive-adapter

Home

Description:

This adapter allows you to work with GoogleDrive. Under the hood it uses official GoogleDrive SDK for node.js. It works in composite with main Flysystem class. Also, you may find useful codebase in @flysystem-ts/common module.

Usage

Import and construct example:

import { Flysystem } from '@flysystem-ts/flysystem';
import { GDriveAdapter } from '@flysystem-ts/google-drive-adapter';
import { join } from 'path';
import { google } from 'googleapis';
import 'dotenv/config';


async function example() {
    const oaut2Client = {} // ... see documentation how make authentication in googleapis
    const gDriveAdapter = new GoogleDriveAdapter(google.drive({ version: 'v3', auth: oauth2Client });
    const flysystem = Filesystem.init(dropBoxAdapter);
}

Upload example:

import fs from 'fs';

async function upload(flysystem: Filesystem) {
    const pathToFile = join(__dirname, 'relative/path/to/your/file.mp4');

    await flysystem.uploadById(fs.readFileSync(pathToFile), {
        name: 'cool.mp4',
    });
}
1.5.0

2 years ago

1.4.1

2 years ago

1.4.0

2 years ago

1.3.1

2 years ago

1.3.0

2 years ago

1.2.1

2 years ago

1.2.0

2 years ago

1.1.0

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago

0.3.1

2 years ago

0.3.0

2 years ago

0.2.4

2 years ago

0.2.3

2 years ago

0.2.2

2 years ago

0.2.1

2 years ago

0.2.0

2 years ago

0.1.9

2 years ago

0.1.8

2 years ago

0.1.7

2 years ago

0.1.6

2 years ago

0.1.5

2 years ago

0.1.4

2 years ago

0.1.3

2 years ago

0.1.2

2 years ago

0.1.1

2 years ago

0.1.0

2 years ago