You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Full docs available at [https://theoephraim.github.io/node-google-spreadsheet](https://theoephraim.github.io/node-google-spreadsheet)
18
19
19
-
-------------
20
+
---
20
21
21
22
> 🌈 **Installation** - `pnpm i google-spreadsheet`<br/>(or `npm i google-spreadsheet --save` or `yarn add google-spreadsheet`)
22
23
23
24
## Examples
25
+
24
26
_The following examples are meant to give you an idea of just some of the things you can do_
25
27
26
28
> **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 like so:
@@ -87,7 +87,7 @@ const rows = await sheet.getRows(); // can pass in { limit, offset }
87
87
88
88
// read/write row values
89
89
console.log(rows[0].get('name')); // 'Larry Page'
90
-
rows[1].set('email') ='sergey@abc.xyz'; // update a value
90
+
rows[1].set('email', 'sergey@abc.xyz'); // update a value
91
91
rows[2].assign({ name:'Sundar Pichai', email:'sundar@google.com' }); // set multiple values
92
92
await rows[2].save(); // save updates on a row
93
93
await rows[2].delete(); // delete a row
@@ -108,12 +108,12 @@ userRows[0].get('badColumn'); // <- will throw a type error
108
108
```
109
109
110
110
More info:
111
+
111
112
-[GoogleSpreadsheetWorksheet > Working With Rows](https://theoephraim.github.io/node-google-spreadsheet/#/classes/google-spreadsheet-worksheet#working-with-rows)
awaitsheet.saveUpdatedCells(); // save all updates in one call
132
132
```
133
+
133
134
More info:
135
+
134
136
-[GoogleSpreadsheetWorksheet > Working With Cells](https://theoephraim.github.io/node-google-spreadsheet/#/classes/google-spreadsheet-worksheet#working-with-cells)
> **This module provides an intuitive wrapper around Google's API to simplify common interactions**
165
167
166
168
While Google's v4 sheets API is much easier to use than v3 was, the official [googleapis npm module](https://www.npmjs.com/package/googleapis) is a giant autogenerated meta-tool that handles _every Google product_. The module and the API itself are awkward and the docs are pretty terrible, at least to get started.
@@ -169,7 +171,6 @@ While Google's v4 sheets API is much easier to use than v3 was, the official [go
169
171
This module makes trade-offs for simplicity of the interface.
170
172
Google's API provides a mechanism to make many requests in parallel, so if speed and efficiency are extremely important to your use case, you may want to use their API directly. There are also many lesser-used features of their API that are not implemented here yet.
171
173
172
-
173
174
## Support & Contributions
174
175
175
176
This module was written and is actively maintained by [Theo Ephraim](https://theoephraim.com).
@@ -189,4 +190,5 @@ The docs site is generated using [docsify](https://docsify.js.org). To preview a
189
190
The content lives in markdown files in the docs folder.
190
191
191
192
## License
193
+
192
194
This is free and unencumbered public domain software. For more info, see https://unlicense.org.
0 commit comments