Skip to content

larryteal/json-key-path-list

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

json-key-path-list

Generate json key path list.

Usage

  const jsonKeyPathList = require('json-key-path-list');

  const jsonObj = {
    foo: 'foov',
    bar: {
      b: 'b',
      a: 'a',
      r: 'r'
    },
    ward: [{
      w: 'w1',
      d: 'd1'
    }, {
      w: 'w2',
      d: 'd2'
    }]
  };

  const keyPathList = jsonKeyPathList(jsonObj);

  console.log(keyPathList);
  // ["foo", "bar.b", "bar.a", "bar.r", "ward.0.w", "ward.0.d", "ward.1.w", "ward.1.d"]

About

get json key path list

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published