sheet-db
sheet-db copied to clipboard
Sheet connect() not work as expected
My google spreadsheet is public read & write able.
My code t.js is as the following:
const connect = require('sheet-db')
// https://docs.google.com/spreadsheets/d/106lfsqgEOMqRX3apK3qGbVcjQIaCK7EudHHI3-TpEKQ/edit?usp=sharing
const sheet = connect('106lfsqgEOMqRX3apK3qGbVcjQIaCK7EudHHI3-TpEKQ')
sheet
.info().then(console.info)
.catch(console.error)
It show the following error message when I run it:
$ node t.js
Error: The response contains invalid data
at _callee$ (/home/huan/git/mike-bo/node_modules/sheet-db/lib/rest_client.js:44:31)
at tryCatch (/home/huan/git/mike-bo/node_modules/regenerator-runtime/runtime.js:65:40)
at Generator.invoke [as _invoke] (/home/huan/git/mike-bo/node_modules/regenerator-runtime/runtime.js:303:22)
at Generator.prototype.(anonymous function) [as next] (/home/huan/git/mike-bo/node_modules/regenerator-runtime/runtime.js:117:21)
at step (/home/huan/git/mike-bo/node_modules/sheet-db/lib/rest_client.js:588:191)
at /home/huan/git/mike-bo/node_modules/sheet-db/lib/rest_client.js:588:361
at process._tickCallback (internal/process/next_tick.js:68:7)
Valid point, I need to update the Readme. Thing is you still need an access token even you are trying to read a public spreadsheet, so there is no "tokenless" scenario. I'll update a readme and add a check to throw more meaningful error.