@zishone/dotnotate

A utility function to convert JSON objects to dotnotation

Usage no npm install needed!

<script type="module">
  import zishoneDotnotate from 'https://cdn.skypack.dev/@zishone/dotnotate';
</script>

README

dotnotate NPM Build codecov License

A utility function to convert JSON objects to dotnotation

Installation

$ npm i @zishone/dotnotate

Usage

1. Import dotnotate

const { dotnotate } = require('@zishone/dotnotate');

2. Dotnotate

const obj = { a: { b: { c: 1 } } };

const dotnotatedObj = dotnotate(obj);

console.log(JSON.stringify(dotnotatedObj, null, 2))
// {
//   'a.b.c': 1
// }

Authors

  • Zishran Garces

See also the list of contributors who participated in this project.

License

This project is licensed under the MIT License - see the LICENSE file for details.