sheetsql is a JavaScript/TypeScript library (currently at version 0.1.7) that enables developers to interact with Google Spreadsheets as if they were a simple database. It provides a programmatic API for performing CRUD (Create, Read, Update, Delete) operations on spreadsheet data, effectively turning a Google Sheet into a 'single source of truth' for non-technical users. This approach is particularly useful for scenarios where a full-fledged Content Management System (CMS) is overkill, but programmatic access to frequently updated spreadsheet data is required. The library is currently in an early development stage, indicated by its low version number, suggesting that future releases might introduce breaking changes. It differentiates itself by offering a direct, code-driven interface to Google Sheets data without requiring intermediate database synchronization, simplifying workflows for data managed primarily by business users.
npm install sheetsqlVerified import paths — ran on the pinned version, not inferred.
Demonstrates how to initialize a `Database` instance with a Google Service Account key, load data from a spreadsheet, and perform basic CRUD operations (insert, find, update, remove).
Implement explicit type conversion logic in your application code (e.g., `parseInt(doc.age)`, `String(myNumber)`).
Refer to the Google Cloud documentation for creating a Service Account and ensure the service account email has 'Editor' access to your Google Spreadsheet.
Set environment variables like `HTTP_PROXY=http://your.proxy.com:8080` and, if necessary, `NO_PROXY=*` before running your application.