Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jpillora/node-google-sheets
Google Sheets v4 API using Node.js
https://github.com/jpillora/node-google-sheets
Last synced: 3 months ago
JSON representation
Google Sheets v4 API using Node.js
- Host: GitHub
- URL: https://github.com/jpillora/node-google-sheets
- Owner: jpillora
- Created: 2019-01-05T04:46:28.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2023-04-30T04:37:16.000Z (over 1 year ago)
- Last Synced: 2024-10-14T11:41:35.688Z (3 months ago)
- Language: JavaScript
- Size: 35.2 KB
- Stars: 45
- Watchers: 6
- Forks: 7
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Google spreadsheets V4 API using Node
Instead of upgrading my old Google Spreadsheets module [`edit-google-spreadsheet`](https://github.com/jpillora/node-edit-google-spreadsheet) to support the Google Sheets v4 API, I've chosen to deprecate it, and provide a guide on how to use the `googleapis` module directly. The `googleapis` module, along with the Sheets v4 API provides:
- Faster responses
- More features
- Uses JSON instead of XML
- `async`/`await` supportSee example (`eg`) files in this repository for more information
---
Tips:
- The Node.js API mirrors the "REST Resources" found in the documentation https://developers.google.com/sheets/api/reference/rest/.
- Use a TypeScript enabled editor for useful auto-completes### How to run the examples
The following process creates a new OAuth application (Client ID/Secret) and gives it access to your Google account's spreadsheets (Refresh token) and stores the results into `credentials.json`
1. Get your credentials
1. Go to https://console.cloud.google.com/apis/dashboard
1. Click "Enable APIs and Services"
1. Search "Sheets"
1. Click "Enable"
1. Go to https://console.developers.google.com/apis/credentials/oauthclient
1. **IMPORTANT** Choose "Desktop app" and choose a name
1. Should find a form with: Client ID, Client secret
1. Run `node credentials-fill.js` which will update `credentials.json`
1. Run the examples (`eg-*.js`)#### MIT License
Copyright © 2018 Jaime Pillora <[email protected]>
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
'Software'), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.