object-to-google-spreadsheet
Advanced tools
Comparing version 1.0.6 to 1.0.7
12
index.js
@@ -43,5 +43,9 @@ const ArrayToGoogleSheets = require('array-to-google-sheets'); | ||
const {sheetName, rowName, properties, a1Field, sort, removeBase} = options; | ||
const {sheetName, a1Field, sort, removeBase} = options; | ||
// if rowName or properties were not provided get them automatically | ||
const rowName = options.rowName ? options.rowName : Object.keys(docs[0])[0]; | ||
const properties = options.properties ? options.properties : Object.keys(docs[0])[1]; | ||
let repData = jsonToGssFormat(docs, rowName, properties, a1Field, sort); | ||
// clean the data | ||
@@ -58,3 +62,5 @@ repData = repData.map(x => x.map(y => c(y))); | ||
.then(result => { | ||
resolve() | ||
resolve({ | ||
status: "Pushed to the spreadsheet" | ||
}) | ||
}) | ||
@@ -61,0 +67,0 @@ .catch(err => { |
{ | ||
"name": "object-to-google-spreadsheet", | ||
"version": "1.0.6", | ||
"version": "1.0.7", | ||
"description": "Push an array of unstructured data objects into a Google spreadsheet", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -20,4 +20,4 @@ Quickly publish a set of unstructured JSON objects into a Google spreadsheet that you specify. | ||
sheetName: 'My Awesome Report', | ||
rowName: 'person', // the key name of the base of your rows | ||
properties: 'properties', // the array of objects containing your base's properties | ||
rowName: 'person', // (optional) the key name of the base of your rows | ||
properties: 'properties', // (optional) the array of objects containing your base's properties | ||
a1Field: 'details', // the value of the A1 field | ||
@@ -24,0 +24,0 @@ sort: true, // sort fields |
6754
53