gss

google-spreadsheet-stream-reader

This library is aimed at people who need to work with large (several thousand rows) Google spreadsheets.

Showing:

Popularity

Downloads/wk

11

GitHub Stars

0

Maintenance

Last Commit

7yrs ago

Contributors

1

Package

Dependencies

10

Size (min+gzip)

229.2KB

License

MIT

Type Definitions

Tree-Shakeable

No?

Categories

Readme

This library is aimed at people who need to work with large (several thousand rows) Google spreadsheets.

To achieve this end, it does three things differently than most comparable libraries:

  1. It uses streams so that at no point must all the spreadsheet rows be loaded into memory.
  2. It lets the consumer of the stream determine just how many rows to return.
  3. It leverages Google's API to allow for querying based on conditions.

Installation

npm install google-spreadsheet-stream-reader

Example

var gsStreamFactory = require("google-spreadsheet-stream-reader").factory;

var gsReadStream = gsStreamFactory
    .email('759184919979-tfinm66j1hq49b3690039o8mfn60gfe3@developer.gserviceaccount.com')
    .keyFile("./primary-documents-key-file.pem")
    .spreadsheetName("TestSpreadsheet")
    .worksheetName("Sheet1")
    .https(true)         //use HTTPS
    .limit(10)           //return only 10 rows
    .query('name = Terrence') //only return rows where name is Terrence
;

//Set up express
var express = require("express");
var router = express.Router();
var app = express();

router.get("/", function(req, res){
    res.setHeader("Content-Type", "application/json; charset=UTF-8");
    gsReadStream.createJsonStream().pipe(res);
});

app.use(router);
app.listen(4000);

TODO

Some kind of writable stream, but that will probably be a separate module. Can you imagine how cool it would be to be able to do this:


var gsReader = gsStreamFactory.createReadStream();
var gsWriter = gsStreamFactory.createWriteStream();

_(gsReader).map(function(row){
    row.name = "A different name!";
    return row;
}).pipe(gsWriter);

Rate & Review

Great Documentation0
Easy to Use0
Performant0
Highly Customizable0
Bleeding Edge0
Responsive Maintainers0
Poor Documentation0
Hard to Use0
Slow0
Buggy0
Abandoned0
Unwelcoming Community0
100