2.2.0 • Published 5 years ago
@ddazal/gsheetreader v2.2.0
gsheetreader
Transform a public Google Spreadsheet to JSON
Install
From npm:
npm install @ddazal/gsheetreaderAs a script tag:
<script src="https://cdn.jsdelivr.net/gh/datasketch/gsheetreader@2/dist/gsheetreader.umd.js"></script>Usage
const id = 'some-google-sheet-public-id';
const gsr = new GSheetReader();
gsr.getJSON(id).then(console.log);Alternatively, the function can receive a number as a second parameter to indicate the sheet that will be read. This second parameter defaults to 1.
// This will read the data from the third sheet
const id = 'some-google-sheet-public-id';
const gsr = new GSheetReader();
gsr.getJSON(id, 3).then(console.log);The getJSON function returns an object with properties data, headers and size.
Roadmap
- Publish to npm registry
- Read multiples sheets within the same spreadsheet