tableize-array

1.1.0 • Public • Published

tableize-array

Generate a table-friendly object by flattening the keys.

Same as tableize but with support for arrays

Installation

$ npm install tableize-array

Example

var tableize = require('tableize-array');
 
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

Readme

Keywords

Package Sidebar

Install

npm i tableize-array

Weekly Downloads

206

Version

1.1.0

License

MIT

Last publish

Collaborators

  • jb55