A tool for precisely extracting essential information from HTML, enhancing machine readability. It removes unnecessary elements and provides the needed data in JSON format
npm install @d-zero/html-distillerA tool for precisely extracting essential information from HTML, enhancing machine readability. It removes unnecessary elements and provides the needed data in JSON format.
``shell`
npm install @d-zero/html-distiller
`ts
import { distill } from '@d-zero/html-distiller';
const html =
;const result = distill(html);
console.log(result);
`Output
`json
{
"tree": [
{
"name": "html",
"attr": {
"lang": "en"
},
"content": [
{
"name": "head",
"content": [
{
"name": "title",
"content": ["Test"]
}
]
},
{
"name": "body",
"content": [
{
"name": "h1",
"content": ["Hello, World!"]
}
]
}
]
}
]
}
``