tableize

0.1.0 • Public • Published

tableize

Generate a table-friendly object by flattening and normalizing the keys.

Installation

$ npm install tableize

Example

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:

{ 'user.id': 123242123,
  'name.first': 'tobi',
  'name.last': 'loki',
  'properties.category': 'Buttons',
  'properties.label': 'Login',
  'context.userAgent': 'Mozilla whatever' }

License

MIT

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 0.1.0
    1
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 0.1.0
    1
  • 0.0.4
    1
  • 0.0.2
    0
  • 0.0.1
    3

Package Sidebar

Install

npm i tableize

Weekly Downloads

5

Version

0.1.0

License

MIT

Last publish

Collaborators

  • tjholowaychuk