# obj-to-table

> Create a table from an array of objects

Latest version **2.0.0** (published 2017-05-27) · MIT license · 0 weekly downloads

## Install

```sh
npm install obj-to-table
pnpm add obj-to-table
yarn add obj-to-table
bun add obj-to-table
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.0.0 |
| Published | 2017-05-27 |
| First published | 2015-07-08 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=4 |
| Dependencies | 5 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 17 |
| Author | Kevin Martensson |
| Maintainers | kevva |
| Keywords | array, cli, convert, object, table |

## Links

- npm: https://www.npmjs.com/package/obj-to-table
- Repository: https://github.com/kevva/obj-to-table
- Homepage: https://github.com/kevva/obj-to-table#readme
- Issues: https://github.com/kevva/obj-to-table/issues
- npm.io page: https://npm.io/package/obj-to-table

## Dependencies (5)

- [arrify](https://npm.io/package/arrify.md) ^1.0.0
- [cli-table](https://npm.io/package/cli-table.md) ^0.3.1
- [term-size](https://npm.io/package/term-size.md) ^1.1.0
- [fill-array](https://npm.io/package/fill-array.md) ^1.0.0
- [object-values](https://npm.io/package/object-values.md) ^1.0.0

## Alternatives

- [@lexical/table](https://npm.io/package/@lexical/table.md) — 3.0M weekly downloads
- [mantine-datatable](https://npm.io/package/mantine-datatable.md) — 98.2K weekly downloads
- [react-native-collapsible-tab-view](https://npm.io/package/react-native-collapsible-tab-view.md) — 70.6K weekly downloads
- [@handsontable/vue3](https://npm.io/package/@handsontable/vue3.md) — 16.1K weekly downloads
- [vuewordcloud](https://npm.io/package/vuewordcloud.md) — 7.2K weekly downloads

## Recent versions

- 2.0.0 (latest) — 2017-05-27
- 1.0.1 — 2015-07-08
- 1.0.0 — 2015-07-08

## README

# obj-to-table [![Build Status](https://travis-ci.org/kevva/obj-to-table.svg?branch=master)](https://travis-ci.org/kevva/obj-to-table)

> Create a table from an array of objects


## Install

```
$ npm install --save obj-to-table
```


## Usage

```js
const objToTable = require('obj-to-table');

const 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

Type: `Array` `Object`

An array of objects containing your data.

#### options

Type: `Object`

See the [cli-table](https://github.com/Automattic/cli-table) options.


## License

MIT © [Kevin Martensson](http://github.com/kevva)

---
_Source: https://npm.io/package/obj-to-table · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
