You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Add end-to-end test for an actual spreadsheet
* Rewrite of helper.js to use new google-spreadsheet module API
* Implement correct search behaviour for mapping data
* Fix test to work on CI environment
* Remove work in progress console.log
* Update README and CHANGELOG
* Add note about fixed security vulnerabilities
* Add test-example.js to check equivalent code in README
Copy file name to clipboardexpand all lines: README.md
+39-35
Original file line number
Diff line number
Diff line change
@@ -1,22 +1,14 @@
1
1
google-spreadsheet-to-json
2
2
==========================
3
3
4
-
**warning : this is a deliberate fork of the original bassarisse/google-spreadsheet-to-json project **
4
+
**2020-02-20 : This fork of `bassarisse/google-spreadsheet-to-json` project adds more tests; implements against the Google v4 API using the latest version of `theoephraim/node-google-spreadsheet` and Service Account credentials.**
5
5
6
-
New goals as follows:
7
-
- ✅ Use github actions and PR flow to manage change
8
-
- ❎ Focus on new v4 google API using theoephraim/node-google-spreadsheet at v3.1.15 with enforced authentication
9
-
- ❎ Add a CI test for end-to-end authentication flow using github secrets
10
-
- ❎ Update README
11
-
- ❎ Use async await pattern instead of promises in examples
12
-
13
-
Please raise an issue / suggestions on this repo if you see space for improvements.
6
+
Please raise an issue or suggestions on the original repo and tag me @johnbeech you see space for improvements - like missing tests or broken functionality.
14
7
15
8
## Description
16
9
17
10
A simple tool to export Google Spreadsheets to JSON files. Can be used though Node API or CLI.
18
11
19
-
20
12
## Installation
21
13
22
14
Command-line:
@@ -29,7 +21,6 @@ Node API:
29
21
$ npm install --save google-spreadsheet-to-json
30
22
```
31
23
32
-
33
24
## Help
34
25
35
26
```
@@ -77,34 +68,40 @@ You can also redirect the output if you omit the filename:
77
68
$ gsjson abc123456789 >> data.json
78
69
```
79
70
80
-
81
71
## Usage (Node API)
82
72
83
73
With the exception of `beautify` and the file path, the same options from the CLI applies here (options like `include-header` becomes `includeHeader`).
84
74
85
75
```javascript
86
-
var gsjson =require('google-spreadsheet-to-json');
- If an array is passed on the `worksheet` option (in CLI, this can be done by repeating the argument) or the `allWorksheets` option is used, the output from each worksheet is returned inside an array (the order is not guaranteed).
107
-
103
+
- A spreadsheet ID can be extracted from its URL - for example `https://docs.google.com/spreadsheets/d/1G2_YLuQeKXCtpOWshqIBazzUeefuOMDZ5q10F2u9MHw/edit#gid=0` becomes `1G2_YLuQeKXCtpOWshqIBazzUeefuOMDZ5q10F2u9MHw`
104
+
- If an array is passed on the `worksheet` option (in CLI, this can be done by repeating the argument) or the `allWorksheets` option is used, the output from each worksheet is returned inside an array; however the order is not guaranteed.
108
105
109
106
## About authentication
110
107
@@ -119,22 +116,29 @@ For quick tests, there's a method to acquire a temporary token:
119
116
120
117
For more detailed information regarding auth methods: https://github.com/theoephraim/node-google-spreadsheet
121
118
122
-
123
119
## Known issues
124
120
125
-
- Public spreadsheets can only be used without authentication if the option "File > Publish to the web" is used in the Google Spreadsheets GUI, even if the spreadsheet is visible to everyone. This problem won't occur when authenticated.
121
+
- Public spreadsheets are not currently supported - although there is a way to access raw JSON from a spreadsheet which could be supported in future: `https://spreadsheets.google.com/feeds/cells/1G2_YLuQeKXCtpOWshqIBazzUeefuOMDZ5q10F2u9MHw/1/public/full?alt=json` - this works if the option "File > Publish to the web" is used in the Google Spreadsheets GUI, even if the spreadsheet is visible to everyone. This problem won't occur when authenticated.
0 commit comments