Socket
Socket
Sign inDemoInstall

edit-google-spreadsheet

Package Overview
Dependencies
Maintainers
1
Versions
34
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

edit-google-spreadsheet

Currently, there are about 3 different node modules which allow you to read data off Google Spreadsheets, though none with a good write API. Enter `edit-google-spreadsheet`. A simple API for editting Google Spreadsheets.


Version published
Weekly downloads
848
increased by67.92%
Maintainers
1
Weekly downloads
 
Created
Source

Node - Edit Google Spreadsheet

Currently, there are about 3 different node modules which allow you to read data off Google Spreadsheets, though none with a good write API. Enter edit-google-spreadsheet. A simple API for editting Google Spreadsheets.

Install
npm install edit-google-spreadsheet
Basic Usage

Create sheet:

  var Spreadsheet = require('edit-google-spreadsheet');

  Spreadsheet.create({
    //auth
    username: '...',
    password: '...',
    spreadsheetId: '...',
    //summary tab
    worksheetId: '...',
    callback: function(err, spreadsheet) {
      if(err) throw err;
      sheetReady(spreadsheet);
    }
  });
  

Update sheet:

  function sheetReady(spreadsheet) {
  
    spreadsheet.add({ 3: { 5: "hello!" } });
  
    spreadsheet.send(function(err) {
      if(err) throw err;
      console.log("Updated Cell at row 3, column 5 to "hello!");
    });
  }
More Examples

Batch edit:

spreadsheet.add([[1,2,3],
                 [4,5,6]]);

Batch edit starting from row 5:

spreadsheet.add({
  5: [[1,2,3],
      [4,5,6]]
});

Batch edit starting from row 5, column 7:

spreadsheet.add({
  5: {
    7: [[1,2,3],
        [4,5,6]]
  }
});

Named cell references:

spreadsheet.add({
  3: {
    4: { name: "a", val: 42 },
    5: { name: "b", val: 21 },
    6: "={{ a }}+{{ b }}"      //forumla with =D3+D5
  }
});

Note: cell a and b are looked up on send()

API

#####spreadsheet.add( obj | array ) Add cells to the batch. See examples.

#####spreadsheet.send( callback ) Sends off the batch of added cells. Clears all cells once complete. Callback has signature: funciton(err, result) {}.

Todo
  • OAuth
  • Create New Spreadsheets
  • Read Spreadsheet data
  • List Spreadsheets on account
  • List Worksheets on spreadsheet
Credits

Thanks to googleclientlogin for easy Google API ClientLogin Tokens

FAQs

Package last updated on 01 Mar 2013

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