Create json blobs from google docs

Hickory Dickory Google Doc

You can use this node script to create JSON objects or files from Google spreadsheet docs. To get started, you'll have to have your Google Doc auto publishing CSV documents.

  • File -> Publish to the web...
  • Select "Automatically republish when changes are made"
  • Click Start Publishing
  • Copy the link within "Get a link to the published data", it's the "key" when running this script.

npm install hickorydickory

If you're planning on running this as a command line script, ensure you've added the -g flag.

var dickory = require('hickorydickory');
    'key'       : '0Aqt4TJ6rH8fTdGlNYnd3aU5iWEJ4dzNzell4UEptUGc',
    'index'     : '1'
}, function(jsonObject){

Just run hickorydickory. The script will prompt you for configuration options, write the .hickorydickory file to the current directory, and automatically update your .gitignore.

The following config options are supported in the .hickorydickory file.

  • key - The google doc key example - 0Aqt4TJ6rH8fTdDdOSXppMmhLQ20zc1FuRG9yRlNGUUE
  • index - The index to set as object keys example - 1
  • file - The output file example - assets/data/datasource.json
  • exports - Specify this if you want the final object to be "exported", example - locations

Hickorydickory will recognize arrays in your google doc if you surround the cell contents with brackets. Example - [item1, item2, item3]