0.0.5 • Published 10 years ago

google-docs-cms v0.0.5

Weekly downloads
7
License
MIT
Repository
github
Last release
10 years ago

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

npm install -g google-docs-cms

Usage

CLI

google-docs-cms 'spreadsheet-id' 'path-to-write-data.json'

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

npm install && npm test
0.0.5

10 years ago

0.0.4

10 years ago

0.0.3

10 years ago

0.0.2

10 years ago

0.0.1

10 years ago