Have opinions about JavaScript? We want to hear them. Take the 2018 JavaScript Ecosystem Survey »

deepkeys

1.0.0 • Public • Published

deepkeys

Have you ever needed to check all the keys in a deeply nested object?

If the answer is yes, then this is the package for you!

This package takes any object and gives you back an array of all the keys on the object. Think of it as a handy recusive Object.keys.

const obj = {
    thing: {
        thing1: {
            thing2: {
                thing3: 'cat'
            }
        }
    }
};
 
deepKeys(obj); //['thing', 'thing1', 'thing2', 'thing3']
 

Keywords

none

install

npm i deepkeys

Downloadsweekly downloads

5

version

1.0.0

license

ISC

last publish

collaborators

  • avatar
Report a vulnerability