https://github.com/lestoni/build-object-paths
Get object keys paths as a string
https://github.com/lestoni/build-object-paths
Last synced: about 1 year ago
JSON representation
Get object keys paths as a string
- Host: GitHub
- URL: https://github.com/lestoni/build-object-paths
- Owner: lestoni
- License: other
- Created: 2015-04-25T15:08:22.000Z (about 11 years ago)
- Default Branch: master
- Last Pushed: 2023-07-12T17:28:46.000Z (almost 3 years ago)
- Last Synced: 2024-03-15T02:46:02.429Z (about 2 years ago)
- Language: JavaScript
- Homepage:
- Size: 13.7 KB
- Stars: 4
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# build-object-paths
small utility to construct object keys paths.
[](https://travis-ci.org/lestoni/build-object-paths)
[](https://nodei.co/npm/build-object-paths/)
## install
```
npm install build-object-paths
```
## examples
```javascript
var objPaths = require('build-object-paths');
var data = {
level1: {
level2: 2,
level3: {
level4: 4,
level5: [1,2,3]
}
},
num: 156
};
console.log(objPaths(data));
```
output
```bash
$ node test.js
$ [ 'level1',
'level1.level2',
'level1.level3',
'level1.level3.level4',
'level1.level3.level5',
'num' ]
```
## API
### objPaths({}#Object) = require('build-object-paths')
Pass in the Object to build paths from.
## license
MIT