@yawnxyz/sheetlog
Advanced tools
Comparing version 0.1.7 to 0.1.8
@@ -11,3 +11,11 @@ { | ||
}, | ||
"exports": "./main.js" | ||
"exports": "./main.js", | ||
"deploy": { | ||
"project": "f36fade9-e8d1-4aa5-bb77-83ed1051dd77", | ||
"exclude": [ | ||
"**/node_modules" | ||
], | ||
"include": [], | ||
"entrypoint": "main.js" | ||
} | ||
} |
@@ -50,2 +50,41 @@ import { Hono } from "npm:hono"; | ||
<div class="bg-white p-6 rounded-lg shadow-md mb-8"> | ||
<p>Sheetlog is a library for logging and retrieving data from Google Sheets. It is designed to be easy to use and integrate into existing projects.</p> | ||
<p>Github repo: <a class="text-blue-500 hover:underline" href="https://github.com/janzheng/sheetlog">https://github.com/janzheng/sheetlog</a></p> | ||
<p>It can either be used in Node:</p> | ||
<pre class="bg-gray-100 p-4 rounded-md overflow-x-auto mb-4"> | ||
import { Sheetlog } from '@yawnxyz/sheetlog'; | ||
const sheet = new Sheetlog({ | ||
sheetUrl: 'YOUR_SHEET_URL', | ||
sheet: 'Sheet1', | ||
}); | ||
await sheet.log({ message: 'Hello world' }); // Basic logging | ||
await sheet.get('123'); // Get by ID | ||
await sheet.put('123', { message: 'Updated' }); // Update by ID | ||
await sheet.delete('123'); // Delete by ID | ||
</pre> | ||
<p>Or as POST requests directly to the Apps Script:</p> | ||
<pre class="bg-gray-100 p-4 rounded-md overflow-x-auto mb-4"> | ||
// Simple POST request example | ||
const response = await fetch('YOUR_SHEET_URL', { | ||
method: 'POST', | ||
headers: { | ||
'Content-Type': 'application/json' | ||
}, | ||
body: JSON.stringify({ | ||
method: 'POST', | ||
sheet: 'Sheet1', | ||
payload: { | ||
message: 'Hello from API', | ||
timestamp: new Date().toISOString() | ||
} | ||
}) | ||
});</pre> | ||
<h2 class="text-xl font-semibold mb-4">Setup</h2> | ||
@@ -58,3 +97,2 @@ <ol class="list-decimal ml-6 mb-6 space-y-2"> | ||
<li>Paste the URL below to start using the demo</li> | ||
<li>Google Sheet Demo Link: <a class="text-blue-500 hover:underline" href="https://docs.google.com/spreadsheets/d/15XoANPN-DAyBkQlN9-s7bCaWzDNibuWTXHFCQMISVK4/edit?usp=sharing" target="_blank">https://docs.google.com/spreadsheets/d/15XoANPN-DAyBkQlN9-s7bCaWzDNibuWTXHFCQMISVK4/edit?usp=sharing</a></li> | ||
</ol> | ||
@@ -69,2 +107,6 @@ | ||
> | ||
<p>As you try the examples below, the commands will be sent to the Apps Script in the above URL, and either read or write to the Google Sheets connected to the app.</p> | ||
<p>This demo uses the following Google Sheet: <a class="text-blue-500 hover:underline" href="https://docs.google.com/spreadsheets/d/15XoANPN-DAyBkQlN9-s7bCaWzDNibuWTXHFCQMISVK4/edit?usp=sharing">https://docs.google.com/spreadsheets/d/15XoANPN-DAyBkQlN9-s7bCaWzDNibuWTXHFCQMISVK4/edit?usp=sharing</a> | ||
</p> | ||
</div> | ||
@@ -312,2 +354,7 @@ | ||
<script src="https://unpkg.com/alpinejs@3.x.x/dist/cdn.min.js" defer></script> | ||
<style> | ||
p { | ||
margin-bottom: 0.5rem; | ||
} | ||
</style> | ||
</body> | ||
@@ -314,0 +361,0 @@ </html> |
{ | ||
"name": "@yawnxyz/sheetlog", | ||
"version": "0.1.7", | ||
"version": "0.1.8", | ||
"description": "a google sheets logging system", | ||
@@ -5,0 +5,0 @@ "main": "index.mjs", |
# Sheetlog | ||
Sheetlog is a simple wrapper to add to and read from Google Sheets. | ||
Sheetlog is a a logging system that turns any Google Sheet into a database. | ||
It can be used to easily save data like logs or form responses to Google Sheets, turning Sheets into simple databases. | ||
It's very helpful for logging console data, record form responses, or store LLM outputs for evaluation outputs. | ||
It also supports authentication and full CRUD operations, turning your Google Sheet into a full-fledged database. | ||
Since Sheets supports up to roughly 200,000 cells per sheet, this makes Sheetlog perfect for toy projects and MVPs that need a "faux", persisted "database". Think of it as a lighter alternative to Notion Database or Airtable, as opposed to something like Firebase or Supabase. | ||
@@ -13,3 +15,5 @@ | ||
Here's a [live demo and usage guide](https://sheetlog.deno.dev/) | ||
## Installation | ||
@@ -282,5 +286,5 @@ | ||
method: "GET_ROWS", | ||
sheet: "testSheet", | ||
startRow: 1, | ||
endRow: 9099 | ||
sheet: "testSheet", | ||
startRow: 1, | ||
endRow: 9099 | ||
}); | ||
@@ -306,2 +310,4 @@ ``` | ||
| BATCH_UPDATE | Update multiple rows efficiently | | ||
| GET_SHEETS | Get information about all sheets in the spreadsheet | | ||
| GET_CSV | Export a specific sheet as CSV | | ||
@@ -536,2 +542,13 @@ | ||
// Get information about all sheets | ||
{ | ||
"method": "GET_SHEETS" | ||
} | ||
// Get CSV export of a specific sheet | ||
{ | ||
"method": "GET_CSV", | ||
"sheet": "testSheet" | ||
} | ||
``` |
Sorry, the diff of this file is not supported yet
205808
2793
550