convert-json-to-dot

Convert json object to dot notation

Usage no npm install needed!

<script type="module">
  import convertJsonToDot from 'https://cdn.skypack.dev/convert-json-to-dot';
</script>

README

convert-json-to-dot

Convert nested JSON object to dot notation

Installation

npm i -g convert-json-to-dot

Example

yourFile.json

{
  "person": {
    "firstname": "Anton",
    "lastname": "Posokhin",
    "parents": {
      "father": "Yuri",
      "mother": "Tatyana"
    }
  }
}
convert-json-to-dot --from <path to yourFile.json> --to <destination path>

Result

result.json

{
  "person.firstname": "Anton",
  "person.lastname": "Posokhin",
  "person.parents.father": "Yuri",
  "person.parents.mother": "Tatyana"
}

Thanks for using this package

if you need my help you can write to me at posohin7@gmail.com. You can also open bugs.