0.0.8 • Published 2 years ago

tables2json v0.0.8

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

tables2json

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

Install

npm install tables2json

Update version

npm install tables2json@latest

Require / Import

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

Use

  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 );
  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 );
  // 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

0.0.8

2 years ago

0.0.6

3 years ago

0.0.5

3 years ago

0.0.4

3 years ago

0.0.3

3 years ago

0.0.2

3 years ago

0.0.1

3 years ago