Skip to content

maugenst/htmltojson

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

htmltojson

Convert HTML page parts provided in an Object Array into JSON objects:

Installation

npm install htmltojson

Usage

const htmltojson = require('../lib/htmltojson');

const converted = htmltojson.convert('HTML-STRING', {
    tags: ['table', 'ol', 'ul']
})

console.log(converted)

// Result:
{
    table: [
        0: [...]
        1: [...]
        2: [...]
    ],
     ol: [
        0: [...]
        1: [...]
        2: [...]
    ],
    ul: [
         0: [...]
         1: [...]
         2: [...]
    ]
}

Abstraction

Providing an Abstraction layer for implementing own "toJson"-conversions. Once a reference to htmltojson is defined a package can extend AbstractToJson and must implement the two methods convert and convertUrl.

About

Convert HTML page parts into JSON objects

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors