Skip to content
Echo converts HTML tables into JSON/CSV objects. Use it to make html data easy to transport.
JavaScript
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
output
src
static
test Added additional testing. Changed path to use path.join to fix issue#… Jun 24, 2016
.editorconfig
.eslintrc.js
.gitattributes Added gitattributes to fix linguist stats. Jun 24, 2016
.gitignore Added additional testing. Changed path to use path.join to fix issue#… Jun 24, 2016
.travis.yml
LICENSE
README.md
examples.js Updated requirements for test and adjusting the timeout period. Lastl… Feb 17, 2016
package.json

README.md

Echo - Convert HTML tables to JSON/CSVs

Nix Build: TravisCI: Travis CI Status

Windows Build: AppVeoyr: AppVeyour

NPM: NPM Version

Echo is able to read tables from a website or a html file and convert it to JSON or CSV. Perfect for saving data from a website and loading it into excel, database, etc.

Echo Icon

Install

npm i "echo-table-2-file"

Example usage

For our examples we will be using the tables from www.coolgithubprojects.com. We use .convert for local HTML files and .convertUrl for online retrieval.

// Site was saved locally in process folder. The follow code will read it and generate the json.
var echo = require('echo-table-2-file');
echo.convert('process', 'output', 'json');
// Here we grab the tables from the site and save the data to a csv (default type).
var echo = require('echo-table-2-file');
echo.convertUrl('https://www.coolgithubprojects.com', 'output');
// Lastly, we filter the tables to only include the month table (based on table ID).
var echo = require('echo-table-2-file');
echo.convertUrl('https://www.coolgithubprojects.com', 'output', 'months');

/* OUTPUT EXAMPLE : ./output/month.csv

  "0","Language","Change","Name"
  "","JavaScript","+5607","iojs/io.js"
  "","Go","+5439","golang/go"
  "","Other","+4581","prakhar1989/awesome-courses"
  "","JavaScript","+4045","dimsemenov/PhotoSwipe"
  "","PHP","+3284","isohuntto/openbay"
  ...

*/

Contributing

Pull requests welcome!

You can’t perform that action at this time.