Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/segment-boneyard/tableize
Generate a table-friendly object by flattening and normalizing the keys
https://github.com/segment-boneyard/tableize
Last synced: about 5 hours ago
JSON representation
Generate a table-friendly object by flattening and normalizing the keys
- Host: GitHub
- URL: https://github.com/segment-boneyard/tableize
- Owner: segment-boneyard
- Created: 2014-03-12T17:40:09.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2014-06-24T00:10:56.000Z (over 10 years ago)
- Last Synced: 2024-11-03T16:38:56.876Z (12 days ago)
- Language: JavaScript
- Size: 172 KB
- Stars: 48
- Watchers: 42
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: Readme.md
- Changelog: History.md
Awesome Lists containing this project
README
# tableize
Generate a table-friendly object by flattening and normalizing the keys.
## Installation
```
$ npm install tableize
```## Example
```js
var tableize = require('tableize');var obj = tableize({
user: {
id: 123242123,name: {
first: 'tobi',
last: 'loki'
},properties: {
category: 'Buttons',
label: 'Login'
},context: {
userAgent: 'Mozilla whatever'
}
}
});console.log(obj);
```yields:
```js
{ 'user.id': 123242123,
'name.first': 'tobi',
'name.last': 'loki',
'properties.category': 'Buttons',
'properties.label': 'Login',
'context.userAgent': 'Mozilla whatever' }
```# License
MIT