{"id":15041110,"url":"https://github.com/rahul-jha98/sheets-database","last_synced_at":"2026-03-08T00:31:38.734Z","repository":{"id":39118461,"uuid":"325007481","full_name":"rahul-jha98/sheets-database","owner":"rahul-jha98","description":"Library to help use a Google Sheet as a database","archived":false,"fork":false,"pushed_at":"2023-04-20T07:11:20.000Z","size":191,"stargazers_count":74,"open_issues_count":2,"forks_count":6,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-08-09T15:56:45.373Z","etag":null,"topics":["cms","database","db","google-sheets","sheets","sheets-api","spreadsheets"],"latest_commit_sha":null,"homepage":"https://rahul-jha98.github.io/sheets-database/","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rahul-jha98.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2020-12-28T12:31:39.000Z","updated_at":"2025-08-04T05:47:09.000Z","dependencies_parsed_at":"2025-04-14T10:35:35.035Z","dependency_job_id":"85ce29bd-db48-46c2-be9e-e911e288b6c9","html_url":"https://github.com/rahul-jha98/sheets-database","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/rahul-jha98/sheets-database","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rahul-jha98%2Fsheets-database","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rahul-jha98%2Fsheets-database/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rahul-jha98%2Fsheets-database/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rahul-jha98%2Fsheets-database/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rahul-jha98","download_url":"https://codeload.github.com/rahul-jha98/sheets-database/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rahul-jha98%2Fsheets-database/sbom","scorecard":{"id":758997,"data":{"date":"2025-08-11","repo":{"name":"github.com/rahul-jha98/sheets-database","commit":"168ca2b543860bb4af727d46d7378065bd39243d"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3,"checks":[{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Code-Review","score":0,"reason":"Found 0/30 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'main'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}}]},"last_synced_at":"2025-08-22T22:42:40.544Z","repository_id":39118461,"created_at":"2025-08-22T22:42:40.545Z","updated_at":"2025-08-22T22:42:40.545Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30238857,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-08T00:30:53.000Z","status":"ssl_error","status_checked_at":"2026-03-08T00:30:44.061Z","response_time":53,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cms","database","db","google-sheets","sheets","sheets-api","spreadsheets"],"created_at":"2024-09-24T20:45:33.945Z","updated_at":"2026-03-08T00:31:38.703Z","avatar_url":"https://github.com/rahul-jha98.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp class='logo'\u003e\n  \u003cimg alt=\"logo\" src=\"https://raw.githubusercontent.com/rahul-jha98/sheets-database/main/docs/assets/imgs/logo.svg\" width=\"480\"\u003e\n\u003c/p\u003e\n\n[![NPM version](https://img.shields.io/npm/v/sheets-database)](https://www.npmjs.com/package/sheets-database)\n[![License](https://img.shields.io/badge/license-MIT-green)](https://raw.githubusercontent.com/rahul-jha98/sheets-database/main/LICENSE)\n\n\u003e Library to help use a Google Sheet as a database (or CMS)\n\n\n## Features\n- Simple \u0026 Intuitive API\n- Supports most of the simple operations needed in a database\n- Multiple auth options - Service Account, OAuth, Access Token and API Key\n- Provides method to reduce memory and network usage to optimize for your use case.\n\n **Docs site -**\nFull docs available at [https://rahul-jha98.github.io/sheets-database/](https://rahul-jha98.github.io/sheets-database/) \n\n\n\u003e 🚀 **Installation** - `npm i sheets-database --save` or `yarn add sheets-database`\n\n## Examples\n_the following examples are meant to give you an idea of just some of the things you can do_\n\n\u003e **IMPORTANT NOTE** - To keep the examples concise, I'm calling await [at the top level](https://v8.dev/features/top-level-await) which is not allowed by default in most versions of node. If you need to call await in a script at the root level, you must instead wrap it in an async function.\n\n\n### Working with Tables\n```javascript\nconst { SheetDatabase } = require('sheets-database');\n\n// Initialize the Database with doc ID (long id in the sheets URL)\nconst db = new SheetDatabase('\u003cthe sheet ID from the url\u003e');\n\n// Initialize Auth\n// see more available options at https://rahul-jha98.github.io/sheets-database/#/getting-started/authentication\nawait db.useServiceAccount({\n  client_email: process.env.GOOGLE_SERVICE_ACCOUNT_EMAIL,\n  private_key: process.env.GOOGLE_PRIVATE_KEY,\n});\n\nawait db.sync(); // actually connecting with sheet and fetching data\n\n// ADDING TABLES\nconst table1 = await db.addTable('table1', ['column1', 'column2', 'column3']);\nconst table2 = await db.addTable('table2', ['column1', 'column2']);\n\n// RENAMING TABLES\nawait table1.rename('newTable1'); \n\nawait db.renameTable('table2', 'newTable2');\n\n\n// DELETING TABLES\nawait db.newTable1.drop();\n\nawait db.dropTable('newTable2');\n```\nMore info:\n- [Authentication](https://rahul-jha98.github.io/sheets-database#/getting-started/authentication)\n- [SheetDatabase](https://rahul-jha98.github.io/sheets-database/#/classdocs/sheetdatabase)\n\n\n### Working with Table Entries\n```javascript\n// add a new table\nconst table = await db.addTable('entries', ['name', 'age']);\n\n// Insert Single Entry\nawait table.insertOne({'name': 'Micheal Scott', 'age': 43});\n\n// Insert Multiple Entries\nawait table.insert([\n  {'name': 'Jim Halpert', 'age': 30},\n  ['Dwight Schrute', 35]\n]);\n\nconsole.log(table.getData());\n/**\n * [\n *  {name: 'Micheal Scott', age: 43},\n *  {name: 'Jim Halpert', age: 30},\n *  {name: 'Dwight Schrute', age: 35}\n * ]\n */\n\n// Update Rows\n// Here we add 10 to all the rows where current age is less than 40\nawait table.updateRowsWhere(\n  (currentData) =\u003e (currentData.age \u003c 40),\n  (data) =\u003e {\n    return {age: data.age + 10}\n  });\n\nconsole.log(table.getData());\n/**\n * [\n *  {name: 'Micheal Scott', age: 43},\n *  {name: 'Jim Halpert', age: 40},\n *  {name: 'Dwight Schrute', age: 45}\n * ]\n */\n\n// Delete Rows\nawait table.deleteRowsWhere((data) =\u003e data.name === 'Micheal Scott');\nconsole.log(table.getData());\n/**\n * [\n *  {name: 'Jim Halpert', age: 40},\n *  {name: 'Dwight Schrute', age: 45}\n * ]\n */\n```\nMore Info:\n- [Table](https://rahul-jha98.github.io/sheets-database//#/classdocs/table)\n\n## Why?\n\u003e The library will let you worry only about the CRUD operation you wish to perfrom and handles the task of updating it to the spreadsheet internally.\n\nDo you ever wonder if you can use Google Sheets as a no-cost database? Well, if your application deals with lot of entries and joins across tables than of course it isn't such a good idea. But if you have a **small application or a static website that needs very few dynamic content** there is no point in having a backend that deals with a database to serve those content since you could easily use a Google Sheet to store the data. You could also consider this as an option to get the frontend part's development started by using Google Sheet as a mock database while the actual backend is being built.\n\nBut the Google Sheet's API v4 is a bit awkward with confusing docs, at least to get started. Moreover, the API is not designed to use Sheets API as a database which is why you would require you to deal with the rows and columns data manually to deal with data. With such a steep learning curve to get started the prospect of using it as a database doesn't seems like a good deal. \n\nThe library aims to remove the learning curve completely by providing methods that lets you interact with the database without worrying about the Sheets API at all. \nMoreover the API of the library is quite intuitive to get started with and provides functionalities for most of the database operations.\n\n## Note\n`sheets-database` is heavily inspired by and also borrows some code from [node-google-spreadsheet](https://github.com/theoephraim/node-google-spreadsheet).\n\n## Contributions\n\nThis module was written by [Rahul Jha](https://github.com/rahul-jha98). \n\nContributions are welcome. Make sure to add relevant documentation along with code changes.\nAlso, since I am new to Typescript and still exploring any help in improving the code practices and conventions would be appreciated.\n\nThe docs site is generated using [docsify](https://docsify.js.org). To preview and run locally so you can make edits, install docsify_cli and run `docsify serve ./docs` in the project root folder and head to http://localhost:3000\nThe content lives in markdown files in the docs folder.\n\n## License\n[MIT](https://github.com/rahul-jha98/sheets-database/blob/main/LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frahul-jha98%2Fsheets-database","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frahul-jha98%2Fsheets-database","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frahul-jha98%2Fsheets-database/lists"}