Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/dogsghost/gdrive-json-storage

script for interacting with an app-specific JSON file via Google Drive API
https://github.com/dogsghost/gdrive-json-storage

Last synced: 1 day ago
JSON representation

script for interacting with an app-specific JSON file via Google Drive API

Awesome Lists containing this project

README

        

Read/Write JSON via Google Drive API
---

A reusable script leveraging the Google Drive API.

This script:

- Checks if the user has authorized your app to use their drive, if not it prompts the user to do so.
- Checks if there are any files stored in the AppData folder yet, if not it creates an empty JSON file.
- (NYI) *If there is a file in AppData, it is assumed to be the JSON file and its contents are returned as a JSON object.*
- (NYI) *There is a method that accepts a JSON object and will overwrite the stored JSON file with that object via JSON.stringify.*

Currently the script assumes all you're using the GD API for is to store a JSON file in the App Data folder, reading the file and rewriting to it as necessary.

Browser support is untested but should cover all modern browsers.