
Show HN: Single JavaScript API Client for sheet2api.com - richardARPANET
https://github.com/odwyersoftware/sheet2api-js
======
onion2k
This isn't what it sounds like. Based on the post title and the repo name I
thought this was a library that could read and write data from Google Sheets
and MS Excel Online. It's not that. It's a library to use sheet2api.com, which
is a proxy to read and write JSON data from Google Sheets and MS Excel Online.
All of your data goes through a 3rd party service. That is significantly
different.

The title really should be "Show HN: Single JavaScript API Client for
sheet2api.com"

From a JS front end dev perspective it's not actually very good as a library.
There's literally no error handling at all (it just passes you the error from
XMLHttpRequest; it could do so much more), there's no auth, and it's based on
the old XMLHttpRequest API rather than the more modern, and much better in my
opinion, fetch() API.

~~~
rat9988
> it's based on the old XMLHttpRequest API rather than the more modern, and
> much better in my opinion, fetch() API.

I fail to see what is wrong about it.

~~~
onion2k
XMLHttpRequest is callback based and has an _interesting_ API. fetch was
written to be a sensible replacement. It does nice things like supporting
promises by default and handling request cancellation.

~~~
lhorie
XHR and fetch were in a "old thing is deprecated, new thing is not ready" sort
of state for the longest time.

XHR always supported aborting requests, along with progress callbacks. Also,
IE11 doesn't support fetch, so you'd need to bring in a polyfill for it and
for Promise there. (And FormData, and Blob and etc, if we're talking full spec
compliance)

Considering this history, I wouldn't dismiss an XHR-based implementation so
fast.

------
Moghammed
Nice, this looks like something i might use to mock an api server in the early
stages of a project.

~~~
qerim
You're better using Postman for this case:
[https://learning.postman.com/docs/designing-and-
developing-y...](https://learning.postman.com/docs/designing-and-developing-
your-api/mocking-data/setting-up-mock/)

------
mmmqaq
I think authorization is the most important part to avoid randos flood your
"database". Otherwise, why do not just use the Google Sheets API.

