@yawnxyz/sheetlog
Advanced tools
Comparing version 0.0.7 to 0.0.8
{ | ||
"name": "@yawnxyz/sheetlog", | ||
"version": "0.0.7", | ||
"version": "0.0.8", | ||
"description": "simple console.log to google sheets", | ||
@@ -5,0 +5,0 @@ "main": "index.mjs", |
@@ -28,5 +28,7 @@ | ||
``` | ||
sheet.log({some: "data}, { | ||
sheet: "sheetName", // custom sheet name | ||
sqid: [new Date().getTime(), userId, postId, commentId] // example of adding more items into a sqid for referencing | ||
sheet.log( | ||
{Name: "First Name"}, | ||
{ | ||
sheet: "sheetName", // custom sheet name | ||
sqid: [new Date().getTime(), userId, postId, commentId] // example of adding more items into a sqid for referencing | ||
}) | ||
@@ -38,5 +40,7 @@ ``` | ||
let customSheet = sheet.setup({ | ||
SHEET_URL: "some custom sheet url", | ||
sheetUrl: "some custom sheet url", | ||
logPayload: false, // log the payload back to console? | ||
useSqid: false, // creates a sqid based on timestamp for easy referencing | ||
useSqid: false, // creates a sqid based on timestamp for easy referencing | ||
sheet: "sheetName", // custom default sheet name | ||
method: "POST", // default method is POST, but can use "DYNAMIC_POST" for adding more columns, etc. | ||
}) | ||
@@ -46,10 +50,13 @@ ``` | ||
Here's two ways to use sheet.log: | ||
``` | ||
import sheet from '@yawnxyz/sheetlog'; | ||
sheet.setup({ sheet: "Names" }); | ||
sheet.log({ Name: "Test Name" }); | ||
``` | ||
import sheet, { Sheet } from './index.mjs'; | ||
// sheet.setup({ sheetUrl: "123" }); | ||
sheet.log({ a: 1, b: 2 }); | ||
You can setup and create multiple Sheet objects: | ||
``` | ||
import { Sheet } from '@yawnxyz/sheetlog'; | ||
const customSheet = new Sheet(); | ||
@@ -56,0 +63,0 @@ customSheet.setup({ |
Sorry, the diff of this file is not supported yet
21874
521
98