Neptunian Parity Mnemonic

    sheet-loader

    2.1.5 • Public • Published

    sheet-loader

    Google Spreadsheet loader wrapper.

    install

    npm install sheet-loader
    

    usage

    initialize

    const SheetLoader = require('sheet-loader');
    
    const sheetLoader = new SheetLoader({
        sheetKey: 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX',
        keyFilePath: './xxxxxxxx-xxxxxxx.json'
    });

    load data with column scheme

    sheetLoader.loadRecords({
        sheetTitle: 'sample sheet',
        columns: {
            name: '名前',
            message: '文章',
            year: '年',
            month: '月',
            date: '日'
        }
    }).then((records) => {
        records.forEach(function (row, index) {
            console.log('========================');
            console.log('name:\t' + row.name);
            console.log('birth day:\t' + [row.year, row.month, row.date].join('.');
        });
    });

    load raw sheet data

    sheetLoader.loadRows('sample sheet').then((rows) => {
        console.log(rows);
    });

    export records to json file

    sheetLoader.exportRecords('./sample.json', {
        sheetTitle: 'sample sheet',
        columns: {
            name: '名前',
            message: '文章',
            year: '年',
            month: '月',
            date: '日'
        }
    }).then(() => {
        console.log('done.');
    });

    auth with raw credentials

    const sheetLoader = new SheetLoader({
        sheetKey: 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX',
        credentials: {
            client_email: 'xxxxxxxxxxxxxxx@developer.gserviceaccount.com',
            private_key: 'XXXXXXXXXXXXXXX'
        },
    });

    Keywords

    none

    Install

    npm i sheet-loader

    DownloadsWeekly Downloads

    19

    Version

    2.1.5

    License

    ISC

    Unpacked Size

    5.23 kB

    Total Files

    3

    Last publish

    Collaborators

    • fnobi