Google Sheets API メモ
諸々必要なもの
- Node.js
18.13.0 を使用。普通に LTS。 Google Sheets API のクライアントライブラリ
- 今回はこっち。 https://github.com/googleapis/google-api-nodejs-client
すでにメンテナンスモードに入っているらしい。 - 新しいクライアントはこっちだけど、まだ Sheets API は実装されていない。 https://github.com/googleapis/google-cloud-node
リストになければ古い方を使えって言ってる。If the service is not listed above, google-api-nodejs-client interfaces with additional Google Cloud APIs using a legacy REST interface.
- 今回はこっち。 https://github.com/googleapis/google-api-nodejs-client
Google の Quick Start ドキュメント https://developers.google.com/sheets/api/quickstart/nodejs ほぼそのまま動く。readFile と writeFile はそれぞれ readFileSync と writeFileSync でよい。
次にやりたいこと
- スタイルを変えたい
- Vue と React を共存させられるらしいのでちょっと調べる