Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

google-spreadsheet-reader

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

google-spreadsheet-reader

Converts a Google SpreadSheet to a pretty JSON.

  • 0.2.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
3
increased by200%
Maintainers
1
Weekly downloads
 
Created
Source

google-spreadsheet-reader

Converts a Google SpreadSheet to a pretty JSON.

This works with both server server-side and client-side :)

Demo Click here

Home

Install

$ npm install google-spreadsheet-reader

Preparation

Publish to the web

Select [File > Publish to the web…]

Publish to the web

Click [Publish]

Start publish

Done!

Published

Customize documents

After toggle [Published content & settings], select documents you want to publish. Then click [Start publishing]

Custom documents

Stop publishing

After toggle [Published content & settings], click [Stop publishing]

Stop publish

Usage

Example

For example, see this spreadsheet example.

Get key

Use the key from the URL.

Copy key

var SpreadSheet = require('google-spreadsheet-reader');

// Create SpreadSheet Object
var spreadSheet = new SpreadSheet('1lBbCRh6N2Ozz8oEB9fIRN4vuUNQhErqGbAQbHAu2w5Q');

Basic example:

spreadSheet.load()
  .then(function(res) { console.log(res); }) // beautiful JSON!
  .catch(function(err) { console.error(err.message); }); // Aw, something happened.

Result:

Copy key

Options:

You can change the property names to camelCase by setting the camelcase flag to true.

spreadSheet.load({ camelcase: true })
  .then(function(res) { console.log(res); }) // JSON with camelcased properties!
  .catch(function(err) { console.error(err.message); });

Result:

Copy key

Represent data types

You can represent JSON data types with the following spreadsheet configurations.

int / float / number

Add type next to property. (e.g. Population: int)

Continents

Array / JSON

For Array, split items with | (e.g. Genotype: Array)

Blood Type

Convert page items to Object

You can create an Object type and with the first column, define its properties.

Add : Object next to the first property. (e.g. id: Object)

Copy

Keywords

FAQs

Package last updated on 28 Sep 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc