Skip to content

shimonchayim/node-spreadsheets

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

node-spreadsheets

An adaptor for Google Spreadsheets API.

Install

npm install spreadsheets

Usage

require spreadsheets

var authenticate = require("spreadsheets");

authenticate with Google Client Login & get your spreadsheets list

authenticate({
    Email: your email for google account,
    Passwd: password
        
}, function(err, spreadsheets) {
    if(err)
        // handle error
    spreadsheets.list(function(err, list) {
        if(err)
            // handle error
        ........
    });
});

choose a spreadsheet and a worksheet

var spreadsheet = list[ spreadsheet key ];
spreadsheet.worksheet(function(err, sheets) {
    if(err))
        // handle error
    var worksheet = sheets[ *worksheet key* ];
});

get cells and change value

worksheet.cell({
    "min-row": 2,
    "min-col": 4,
    "max-col": 4
    
}, function(err, cells) {
    if(err)
        // handle error
    var cell = cells[ cell key ]; // for example R3C4
    
    cell.changeValue("any value", function(err) {
        if(err)
            // handle error
        ......
    });
});

change styles

worksheet.style({
    scol: 2,
    ecol: 3,
    srow: 2,
    erow: 4

}, function(err, style) {
    if(err)
        // handle error
    style.color("#ff0000", function() {});
    style.bgColor("#ff0000", function() {});
    style.fontsize("10pt", function() {});
    style.align("right", function() {});
});

Dependency

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published