1.1.0 • Published 5 months ago

extract-dom v1.1.0

Weekly downloads
-
License
ISC
Repository
-
Last release
5 months ago

Extract Dom

Extract a specific element's every property including innerHTML.

const extractDom = require('extract-dom');

const data =
  '<html><head></head><body><h2 class="title">Hello there!</h2></body></html>';

const dom = extractDom(data, 'h2.class=title');

// console.log(dom)
/*

[
  {
    innerHTML: 'Hello there!',
    class: 'title'
  }
]

*/
1.1.0

5 months ago

1.0.0

6 months ago