Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/airtoxin/google-spreadsheet-kvs
https://github.com/airtoxin/google-spreadsheet-kvs
Last synced: about 9 hours ago
JSON representation
- Host: GitHub
- URL: https://github.com/airtoxin/google-spreadsheet-kvs
- Owner: airtoxin
- License: mit
- Created: 2020-12-14T10:46:48.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2023-01-06T17:18:27.000Z (almost 2 years ago)
- Last Synced: 2024-10-18T06:08:23.705Z (19 days ago)
- Language: TypeScript
- Size: 1.01 MB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 13
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# google-spreadsheet-kvs
## Install
```shell script
yarn add google-spreadsheet-kvs
```## Usage
```typescript
import { GoogleSpreadsheetStorage } from "google-spreadsheet-kvs";
import credentials from "./path/to/google/serviceAccount/credentials.json";const storage = new GoogleSpreadsheetStorage("SHEET_ID", credentials);
await storage.configure();await storage.set("My key", "Example value");
console.log(await storage.get("My key")); // "Example value"await storage.delete("My key");
console.log(await storage.get("My key")); // null
```## Limitations
This library uses CRC16 hashing algorithm to convert Key to sheet row index.
This means different key maps to same row index, so accidentally override value with different key.