Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

tables2json

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

tables2json

Convert an HTML table node to a javascript object.

  • 0.0.8
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

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

Natan Cabral
natancabral@hotmail.com
https://github.com/natancabral/

Keywords

FAQs

Package last updated on 28 Jul 2022

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc