flatkeys

v0.3.2
Flatten object key hierarchies into a list of strings using a custom separator.
object keys config process.env

flatKeys

npm install flatkeys

Flatten object key hierarchies into a list of strings using a custom separator. Used in Konf to populate a config object from process.env variables.

flatKeys({
    zero: {
        one: 1,
        two: {
            three: 3
        }
    }
})

/*
[
    'zero'
    'zero_one'
    'zero_two'
    'zero_two_three'
]
*/

License

MIT

npm i flatkeys

Metadata

Downloads

Maintainers