Add functionality to support Node-based instances
bpk68 opened this issue · 4 comments
@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.
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!
Documentation updated and support for Node (and Node fetch) is added. Released to NPM this morning as v1.3.0