bassarisse / google-spreadsheet-to-json

Simple tool to export Google Spreadsheets to JSON files, though Node API or CLI
The Unlicense
135 stars 33 forks source link

Saving data to JSON file using Node API #16

Closed m370 closed 7 years ago

m370 commented 7 years ago

Easy to save to a file in the CLI, but can't seem to do it in the Node API. Tried a few variants of the code below. Is this possible when used within a js file?

gsjson({ spreadsheetId: 'spreadsheetId', file: 'data.json' })

m370 commented 7 years ago

Write to file required. Code is here https://pastebin.com/zGRKekhY

bassarisse commented 7 years ago

Yes, for the Node API, I think it's better to just output the object, then the user decides what to do with it.