A lightweight Node.js ORM library for Google Sheets that follows the data-mapper pattern, providing strict TypeScript typing and CRUD operations including batch operations. Current version is 1.0.3, released on npm with TypeScript type definitions. It supports multiple authentication methods (GoogleAuth, direct sheet clients), automatic load balancing across multiple auth clients with quota retries, and optional caching (in-memory or custom providers) with automatic cache invalidation on write operations. Differentiators: ORM-style interface with typed models, batch operations support, and built-in caching vs raw Google Sheets API.
npm install google-spreadsheets-ormNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Initializes GoogleSpreadsheetOrm with Google Auth, defines a typed model, then fetches all rows and creates a new row.
Use import syntax. If you must use require(), ensure your project is ESM (type: module) and use dynamic import.
Verify the actual data format in the sheet and map appropriately. For dates, ensure the sheet cells are in a parseable date format.
Use a shared cache provider (e.g., Redis) and set cacheTtlSeconds appropriately, or disable cache if real-time consistency is required.
Upgrade Node.js to version 14 or later.
Use import syntax or wrap in dynamic import: const { GoogleSpreadsheetOrm } = await import('google-spreadsheets-orm');Pass an array: sheetClients: [client] instead of sheetClients: client.
Use one of the values from the FieldType enum, e.g., FieldType.DATE.