npm.io
0.1.7 • Published 5 years ago

sheetsql-v2

Licence
MIT
Version
0.1.7
Deps
3
Size
217 kB
Vulns
0
Weekly
0

SheetSQL

This is just forked version of original package sheetsql but supports reading info from env variable instead of json file. In most of the case the original one is more than enough.

Usage

import Database from 'sheetsql-v2';

export const db = new Database({
  db: process.env.SPREADSHEET_ID, // sheet id
  table: process.env.SPREADSHEET_NAME, // sheet name, default = Sheet1
  cacheTimeoutMs: 5000, // optional, default = 5000
  clientEmail: process.env.GOOGLE_SHEETS_CLIENT_EMAIL,
  privateKey: (process.env.GOOGLE_SHEETS_PRIVATE_KEY || '').replace(
    /\\n/g,
    '\n'
  ),
});

Docs same as original package