Nietzsche's Preposterous Moustache

    @methodus/google-spreadsheet
    TypeScript icon, indicating that this package has built-in type declarations

    2.0.0 • Public • Published

    V4 Google Spreadsheet Access (node.js)

    Quality Gate Status Maintainability Rating

    This is a CRUD based operations package for Google sheets.

    API

    import { Sheet, getSheet, SheetDataResult } from '@methodus/google-spreadsheet';
    
    const sheet:Sheet = getSheet(sheetId, {client_email: 'test@gmail.com',  private_key: 'XXXXXXXXXXXX'});

    Get filtered rows

    function filter(row: SpreadsheetRow<Model>){
        return row.data.email === email
    }
    
    const result = sheet.query<Model>('Sheet1', filter, start, end, sorts);

    Insert

     
    const data = new Model();
    const result = sheet.insert<Model>('Sheet1',data);
    
    const result = sheet.insertMany<Model>('Sheet1',[data]);

    Update

     
    const data = new Model();
    data.keyid = keyvalue;
    const result = sheet.update<Model>('Sheet1',data);
    
    function filter(row: SpreadsheetRow<Model>){
        return row.data.email === email
    }
    
    const result = sheet.updateBy<Model>('Sheet1',filter, data);

    Delete

     
    const data = new Model();
    data.keyid = keyvalue;
    const result = sheet.delete<Model>('Sheet1',data);
    
    const result = sheet.deleteMany<Model>('Sheet1',[keyvalue,keyvalue,keyvalue]);

    Install

    npm i @methodus/google-spreadsheet

    DownloadsWeekly Downloads

    68

    Version

    2.0.0

    License

    BSD-3-Clause

    Unpacked Size

    77.9 kB

    Total Files

    34

    Last publish

    Collaborators

    • methodusorg
    • nodulus
    • roibh
    • ron-okavi