Latest Threat Research:SANDWORM_MODE: Shai-Hulud-Style npm Worm Hijacks CI Workflows and Poisons AI Toolchains.Details
Socket
Book a DemoInstallSign in
Socket

obj-to-table

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

obj-to-table

Create a table from an array of objects

Source
npmnpm
Version
1.0.0
Version published
Weekly downloads
2
-88.24%
Maintainers
1
Weekly downloads
 
Created
Source

obj-to-table Build Status

Create a table from an array of objects

Install

$ npm install --save obj-to-table

Usage

var objToTable = require('obj-to-table');

objToTable([{
	foo: 'bar',
	cat: 'meow',
	unicorn: 'moo'
}, {
	foo: 'crow',
	cat: 'eek',
	unicorn: 'buzz'
}, {
	foo: 'ow',
	cat: 'hee-haw',
	unicorn: 'hum'
}]);

console.log(table.toString());

/*
┌──────────────┬──────────────┬──────────────┐
│ foo          │ cat          │ unicorn      │
├──────────────┼──────────────┼──────────────┤
│ bar          │ meow         │ moo          │
├──────────────┼──────────────┼──────────────┤
│ crow         │ eek          │ buzz         │
├──────────────┼──────────────┼──────────────┤
│ ow           │ hee-haw      │ hum          │
└──────────────┴──────────────┴──────────────┘
*/

API

objToTable(data, [options])

data

Required
Type: array, object

An array of objects containing your data.

options

Type: object

See the cli-table options.

License

MIT © Kevin Martensson

Keywords

array

FAQs

Package last updated on 08 Jul 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts