Usage const expand = require('expand-hash'); const obj = { 'foo.bar.bar': 'some value', 'foo.qux': 'another value', fez: true }; console.log(expand(obj)); // { // foo: { bar: { bar: 'some value' }, qux: 'another value' }, // fez: true // }