object-to-dot-notation Convert simple objects to dot notation Setup npm i object-to-dot-notation const dotNotation = require('object-to-dot-notation'); const path = dotNotation({ name: { state: { on: { red: "walk" } } } }); console.log(path) // name.state.on.red.walk