Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/techjacker/google-docs-cms
Use google sheets as your cms
https://github.com/techjacker/google-docs-cms
Last synced: 15 days ago
JSON representation
Use google sheets as your cms
- Host: GitHub
- URL: https://github.com/techjacker/google-docs-cms
- Owner: techjacker
- License: mit
- Created: 2014-06-26T09:09:37.000Z (over 10 years ago)
- Default Branch: develop
- Last Pushed: 2014-07-10T21:57:32.000Z (over 10 years ago)
- Last Synced: 2024-09-18T05:25:36.594Z (about 2 months ago)
- Language: JavaScript
- Homepage:
- Size: 174 KB
- Stars: 18
- Watchers: 3
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# google-docs-cms
Google docs is your CMS!
- Creates a JSON object of your google spreadsheet.
- Combines all tabs together with the main sheet into a single json object with the tab names as keys.
- Writes data to disc (optional).## Install
```Shell
npm install -g google-docs-cms
```## Usage
### CLI
```Shell
google-docs-cms 'spreadsheet-id' 'path-to-write-data.json'
```### JavaScript
```JavaScript
var googleDocsCms = require('google-docs-cms');googleDocsCms({
id: 'your-google-spreadsheet-id',
outPath: path.join('where', 'to', 'write', 'data')
}, function(err, res) {
console.log(res); // {tabNameOne: [{...}], tabNameTwo: [{...}]}
console.log(require(path.join('where', 'to', 'write', 'data'))); // {tabNameOne: [{...}], tabNameTwo: [{...}]}
});// also has a promise API
googleDocsCms({...}).then(function(res) {}, function(err), {});
```## API
### Options {object}
### Options.id {string} (Required)
Google spreadsheet id### Options.outPath {string} (Optional)
Path to the file that you want the data to be written to.--------------------------------------------------------------------
## Tests
```Shell
npm install && npm test
```