{"id":42585469,"url":"https://github.com/sheetdb/sheetsu-node","last_synced_at":"2026-01-28T22:40:48.283Z","repository":{"id":57375155,"uuid":"81330185","full_name":"sheetdb/sheetsu-node","owner":"sheetdb","description":"Sheetsu client for Node","archived":false,"fork":false,"pushed_at":"2017-11-23T11:52:01.000Z","size":30,"stargazers_count":15,"open_issues_count":1,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-08-09T15:56:56.546Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sheetdb.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-02-08T12:58:09.000Z","updated_at":"2025-01-11T01:19:07.000Z","dependencies_parsed_at":"2022-09-05T13:21:03.009Z","dependency_job_id":null,"html_url":"https://github.com/sheetdb/sheetsu-node","commit_stats":null,"previous_names":["sheetsu/sheetsu-node"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/sheetdb/sheetsu-node","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sheetdb%2Fsheetsu-node","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sheetdb%2Fsheetsu-node/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sheetdb%2Fsheetsu-node/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sheetdb%2Fsheetsu-node/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sheetdb","download_url":"https://codeload.github.com/sheetdb/sheetsu-node/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sheetdb%2Fsheetsu-node/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28853779,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-28T15:15:36.453Z","status":"ssl_error","status_checked_at":"2026-01-28T15:15:13.020Z","response_time":57,"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":[],"created_at":"2026-01-28T22:40:47.825Z","updated_at":"2026-01-28T22:40:48.278Z","avatar_url":"https://github.com/sheetdb.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# sheetsu-node\n \u003c!-- [![Build passing](https://travis-ci.org/sheetsu/sheetsu-ruby.svg?branch=master)](https://travis-ci.org/sheetsu/sheetsu-ruby) [![Code Climate](https://codeclimate.com/github/sheetsu/sheetsu-ruby/badges/gpa.svg)](https://codeclimate.com/github/sheetsu/sheetsu-ruby) [![Test Coverage](https://codeclimate.com/github/sheetsu/sheetsu-ruby/badges/coverage.svg)](https://codeclimate.com/github/sheetsu/sheetsu-ruby/coverage)\nRuby bindings for the Sheetsu API (https://sheetsu.com/docs). --\u003e\n\n## Installation\n\n```\nnpm install sheetsu-node --save\n```\n\n## Usage\n\n### Generating a Client\n\nYou need to create a new sheetsu function, and populate it with your Sheetsu API URL. You can find this URL on [Sheetsu Dashboard](https://sheetsu.com/your-apis).\n\n```js\nvar sheetsu = require('sheetsu-node');\n\n// create a config file\nvar config = {\n  address: '020b2c0f',\n};\n\n// Create new client\nvar client = sheetsu(config);\n\n```\nfor ES6\n```js\nimport sheetsu from 'sheetsu-node';\n\n// create a config file\nvar config = {\n  address: '020b2c0f',\n};\n\n// Create new client\nvar client = sheetsu(config);\n```\n\nIf you have HTTP Basic Authentication turned on for your API, you should pass `api_key` and `api_secret` here, like:\n```js\n// create a config file\nvar config = {\n  address: '020b2c0f',\n  api_key: 'YOUR_API_KEY',\n  api_secret: 'YOUR_API_SECRET',\n};\n\n// Create new client\nvar client = sheetsu(config);\n```\n\n### CRUD\n\nSheetsu gives you the ability to use full CRUD on your Google Spreadsheet. Remember to populate the first row of every sheet with column names. You can look at [example spreadsheet](https://docs.google.com/spreadsheets/d/1WTwXrh2ZDXmXATZlQIuapdv4ldyhJGZg7LX8GlzPdZw/edit?usp=sharing).\n\n### Create\n[Link to docs](https://sheetsu.com/docs#post)\n\nTo add data to Google Spreadsheets, send a hash or an array of hashes.\n```js\n// Adds single row\nclient.create({ id: 7, name: \"Glenn\", score: \"69\" }).then(function(data) {\n  console.log(data);\n}, function(err){\n  console.log(err);\n});\n\n/// Adds bunch of rows\nrows = [\n  { id: 7, name: \"Glenn\", score: \"69\" },\n  { id: 8, name: \"Brian\", score: \"77\" },\n  { id: 9, name: \"Joe\", score: \"45\" }\n]\nclient.create(rows).then(function(data) {\n  console.log(data);\n}, function(err){\n  console.log(err);\n});\n\n```\n\nBy default, all writes are performed on the first sheet (worksheet). Pass name of a sheet as a 2nd param to add data to other worksheet.\n```js\n// Adds single row to worksheet named \"Sheet3\"\nclient.create({ id: 7, name: \"Glenn\", score: \"69\" }, \"Sheet3\").then(function(data) {\n  console.log(data);\n}, function(err){\n  console.log(err);\n});\n\n```\n\nOn success returns a hash or an array of hashes with created values.\n\n### Read\n[Link to docs](https://sheetsu.com/docs#get)\n\nRead the whole sheet\n```js\nclient.read({ limit, offset, search, sheet }).then(function(data) {\n  console.log(data);\n}, function(err){\n  console.log(err);\n});\n```\n\nYou can pass hash with options\n  - `limit` - limit number of results\n  - `offset` - start from N first record\n  - `search` - hash with search params [(more below)](#search)\n  - `sheet` - get data from named worksheet\n\n```js\n// Get first two rows from worksheet named \"Sheet2\"\nclient.read({ limit: 2, sheet: \"Sheet2\" }).then(function(data) {\n  console.log(data);\n}, function(err){\n  console.log(err);\n});\n\n// Get 5th and 6th record from worksheet named \"Sheet3\"\nclient.read({ limit: 2, offset: 4, sheet: 'Sheet3' }).then(function(data) {\n  console.log(data);\n}, function(err){\n  console.log(err);\n});\n```\n\n#### search\n[Link to docs](https://sheetsu.com/docs#get_search)\n\nTo get rows that match search criteria, pass a hash with search params\n\n```js\n// Get all rows where column 'id' is 'foo' and column 'value' is 'bar'\nclient.read({ search: { id: \"foo\", value: \"bar\" } }).then(function(data) {\n  console.log(data);\n}, function(err){\n  console.log(err);\n});\n\n// Get all rows where column 'First name' is 'Peter' and column 'Score' is '42'\nclient.read({ search: { 'first name': 'Peter', 'Score': 42 } }).then(function(data) {\n  console.log(data);\n}, function(err){\n  console.log(err);\n});\n\n\n// Get first two row where column 'First name' is 'Peter',\n// column 'Score' is '42' from sheet named \"Sheet3\"\nclient.read({\n  limit: 2,\n  search: { 'first name': 'Peter', 'Score': 42 },\n  sheet: 'Sheet3'\n}).then(function(data) {\n  console.log(data);\n}, function(err){\n  console.log(err);\n});\n\n```\n\nOn success returns an array of hashes.\n\n### Update\n[Link to docs](https://sheetsu.com/docs#patch)\n\nTo update row(s), pass column name and its value which is used to find row(s).\n\n``` js\nclient.update(columnName, value, newRow, updateWhole, sheet).then(function(data) {\n  console.log(data);\n}, function(err){\n  console.log(err);\n});\n```\n\n```js\n// Update all columns where 'name' is 'Peter' to have 'score' = 99 and 'last name' = 'Griffin'\nclient.update(\n  'name', // column name\n  'Peter', // value to search for\n  { 'score': 99, 'last name': 'Griffin' } // hash with updates\n).then(function(data) {\n  console.log(data);\n}, function(err){\n  console.log(err);\n});\n```\n\nBy default, [PATCH request](https://sheetsu.com/docs#patch) is sent, which is updating only values which are in the hash passed to the method. To send [PUT request](https://sheetsu.com/docs#put), pass 4th argument being `true`. [Read more about the difference between PUT and PATCH in our docs](https://sheetsu.com/docs#patch).\n\n\n```js\n// Update all columns where 'name' is 'Peter' to have 'score' = 99 and 'last name' = 'Griffin'\n// Empty all cells which matching, which are not 'score' or 'last name'\nclient.update(\n  'name', // column name\n  'Peter', // value to search for\n  { 'score': 99, 'last name': 'Griffin' }, // hash with updates\n  true // nullify all fields not passed in the hash above\n).then(function(data) {\n  console.log(data);\n}, function(err){\n  console.log(err);\n});\n\n```\n\nTo perform `#update` on different than the first sheet, pass sheet name as a 5th argument.\n```js\n// Update all columns where 'name' is 'Peter' to have 'score' = 99 and 'last name' = 'Griffin'\n// In sheet named 'Sheet3'\n// Empty all cells which matching, which are not 'score' or 'last name'\nclient.update(\n  'name', // column name\n  'Peter', // value to search for\n  { 'score': 99, 'last name': 'Griffin' }, // hash with updates\n  true, // nullify all fields not passed in the hash above\n  'Sheet3'\n).then(function(data) {\n  console.log(data);\n}, function(err){\n  console.log(err);\n});\n```\n\nOn success returns an array of hashes with updated values.\n\n### Delete\n[Link to docs](https://sheetsu.com/docs#delete)\n\nTo delete row(s), pass column name and its value which is used to find row(s).\n\n```js\n// Delete all rows where 'name' equals 'Peter'\nclient.delete(\n  'name', // column name\n  'Peter' // value to search for\n).then(function(data) {\n  console.log(data);\n}, function(err){\n  console.log(err);\n});\n```\n\nYou can pass sheet name as a 3rd argument. All operations are performed on the first sheet, by default.\n```js\n// Delete all rows where 'foo' equals 'bar' in sheet 'Sheet3'\nclient.delete(\n  'name', // column name\n  'Peter', // value to search for\n  'Sheet3'\n).then(function(data) {\n  console.log(data);\n}, function(err){\n  console.log(err);\n});\n```\n\nIf success returns `:ok` symbol.\n\n## Development\n\nRun all tests:\n```\nnpm test\n```\n\nRun a nyan version test:\n```\nnpm run nyan-test\n```\n\n## Contributing\n\nBug reports and pull requests are welcome on GitHub at https://github.com/sheetsu/sheetsu-ruby. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.\n\n### Pull Requests\n\n- **Add tests!** Your patch won't be accepted if it doesn't have tests.\n\n- **Create topic branches**. Please, always create a branch with meaningful name. Don't ask us to pull from your master branch.\n\n- **One pull request per feature**. If you want to do more than one thing, please send\n  multiple pull requests.\n\n- **Send coherent history**. Make sure each individual commit in your pull\n  request is meaningful. If you had to make multiple intermediate commits while\n  developing, please squash them before sending them to us.\n\n### Docs\n\n[Sheetsu documentation sits on GitHub](https://github.com/sheetsu/docs). We would love your contributions! We want to make these docs accessible and easy to understand for everyone. Please send us Pull Requests or open issues on GitHub.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsheetdb%2Fsheetsu-node","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsheetdb%2Fsheetsu-node","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsheetdb%2Fsheetsu-node/lists"}