bpk68/g-sheets-api

Add functionality to support Node-based instances

bpk68 opened this issue · 4 comments

bpk68 commented

@DevendraKumarL raised an issue about the package not working when run in a Node environment/instance.

It doesn't work because Node doesn't support the browser-based fetch mechanism which the g-sheets-api depends on to call the Sheet information.

This isn't a bug or issue. However, it would be nice to support Node environments, so we could do with implementing Node-compatible support for fetching the information from Sheets.

I solved this problem by installing node-fetch and adding this before loading g-sheets-api:

global.fetch = require('node-fetch');

Would be nice to add this info to the documentation.

bpk68 commented

Top man, I actually added in a fix for this this morning. I'll be updating the documentation and pushing out a new release on Friday 😄

@bpk68 Glad to know we will be having this fix!

bpk68 commented

Documentation updated and support for Node (and Node fetch) is added. Released to NPM this morning as v1.3.0