bassarisse / google-spreadsheet-to-json

Simple tool to export Google Spreadsheets to JSON files, though Node API or CLI
The Unlicense
134 stars 33 forks source link

JSON within cell #15

Open cfoulston opened 7 years ago

cfoulston commented 7 years ago

Any chance of adding an option to "keep cell JSON" or detect if the cell is itself a JSON object? I get this result:

{
    "Gold": {
        "id": "Gold",
        "cost": 0,
        "values": "{ \"min\":100, \"max\":1000 }"
    }
}

But I really want:

{
    "Gold": {
        "id": "Gold",
        "cost": 0,
        "values": { "min":100, "max":1000 }
    }
}
bassarisse commented 7 years ago

You can of course post-process your data, passing values through JSON.parse. But a more elegant way would be using multiple rows as header (using the option header-size, added in 1.0.0). The values cell would be a merged cell, above min and max. I still have do document this option a "little" better.

cfoulston commented 7 years ago

Ok, yeah documentation on the header-size would help. I'm using this purely as a CLI, so unsure as to how get JSON.parse in there.