/google-spreadsheets-parser

Simple Google Spreadsheets parser for JavaScript

Primary LanguageCoffeeScriptMIT LicenseMIT

build status

google-spreadsheets-parser

Simple Google Spreadsheets parser for JavaScript

Installation

NPM

npm install google-spreadsheets-parser

Manual Download

Download from here

Introduction

  1. Create new Google Spreadsheet

intro-1

  1. Publish spreadsheet

intro-2

You can show following tables from published url

intro-3

  1. Setting

With Browser, import googleSpreadsheetsParser.js in header

<script type="text/javascript" src="/path/to/googleSpreadsheetsParser.js"></script>

Node.js

var GoogleSpreadsheetsParser = require('google-spreadsheets-parser')
  1. Get data
var gss = new GoogleSpreadsheetsParser(publishedUrl, {sheetTitle: 'Sample', hasTitle: true});

console.log(gss.titles);          // ["ID", "Name", "Age"]
console.log(gss.contents);        // [Array[3], Array[3], Array[3], Array[3], Array[3]]
console.log(gss.contents[2][1]);  // Doug

Features

  • .titles : Table titles array in the frst row.
  • .contents : Table data 2d array in the second row later.
  • .toJson() : JSON data of contents.

Demo