Yo! Lets say i have some index.html like this:
<span>Hello</span>
<span>mr.Goover</span>
I also have an app.js where I need to read index.html and store each of these 2 html lines in an object (as strings!):
const html = {
greeting: '<span>Hello</span>',
name: '<span>mr.Goover</span>'
}
The problem: I can read index.html and store the entire content from it as a string:
const content = fs.readFileSync('/index.html').toString()
But I need to separate those 2 lines and put them in the correct objext fileds. Can I do it without using html-parsing npm packages?