# tables2json

> Convert an HTML table node to a javascript object.

Latest version **0.0.8** (published 2022-07-28) · MIT license · 0 weekly downloads

## Install

```sh
npm install tables2json
pnpm add tables2json
yarn add tables2json
bun add tables2json
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.8 |
| Published | 2022-07-28 |
| First published | 2021-06-22 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 5.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | natancabral |
| Maintainers | natancabral |
| Keywords | javascript, json, table to json, tables2json |

## Links

- npm: https://www.npmjs.com/package/tables2json
- Repository: https://github.com/natancabral/tables2json
- Homepage: https://github.com/natancabral/tables2json#readme
- Issues: https://github.com/natancabral/tables2json/issues
- npm.io page: https://npm.io/package/tables2json

## Dependencies (1)

- [jsdom](https://npm.io/package/jsdom.md) ^20.0.0

## Alternatives

- [@mapbox/jsonlint-lines-primitives](https://npm.io/package/@mapbox/jsonlint-lines-primitives.md) — 5.3M weekly downloads
- [reftools](https://npm.io/package/reftools.md) — 3.5M weekly downloads
- [@hey-api/openapi-ts](https://npm.io/package/@hey-api/openapi-ts.md) — 3.5M weekly downloads
- [@mapbox/geojson-rewind](https://npm.io/package/@mapbox/geojson-rewind.md) — 2.4M weekly downloads
- [turbo-stream](https://npm.io/package/turbo-stream.md) — 1.7M weekly downloads

## Recent versions

- 0.0.8 (latest) — 2022-07-28
- 0.0.6 — 2021-06-22
- 0.0.5 — 2021-06-22
- 0.0.4 — 2021-06-22
- 0.0.3 — 2021-06-22
- 0.0.2 — 2021-06-22

## README

# tables2json

Convert an HTML tables node to a javascript object or array.


## Install

```bash
npm install tables2json
```

## Update version 

```bash
npm install tables2json@latest
```

## Require / Import

```js
  const { oneTable2json, allTables2json } = require("tables2json");
  // import { oneTable2json, allTables2json } from "tables2json";
```
```js
  const tables2json = require("tables2json");
  // import tables2json from "tables2json";
```

## Use

```js
  const tables2json = require("tables2json");
  // get element by id
  const table = tables2json.one('table_id'); // object
  // get all tables
  const tables = tables2json.all(); // array
  // print
  console.log( table, tables );
```

```js
  const { oneTable2Json, allTables2Json } = require("tables2json");
  // get element by id
  const table = oneTable2Json('table_id'); // object
  // get all tables
  const tables = allTables2Json(); // array
  // print
  console.log( table, tables );
```

```js
  // return 
  {
    headers: [],
    rows: [],
  }
  // usable to pdfkit-table
  // https://www.npmjs.com/package/pdfkit-table
  // https://github.com/natancabral/pdfkit-table#readme
```

## Changelogs

### 0.0.6

+ void when table content is empty

### 0.0.1

+ initial functions
+ **Thank you, contributors!**

## License

Copyright (c) Natan Cabral
Licensed under the MIT license.

## Author

<table>
  <tr>
    <td>
      <img src="https://github.com/natancabral.png?s=100" width="100"/>
    </td>
    <td>
      Natan Cabral<br />
      <a href="mailto:natancabral@hotmail.com">natancabral@hotmail.com</a><br />
      <a href="https://github.com/natancabral/">https://github.com/natancabral/</a>
    </td>
  </tr>
</table>

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