from-html: Get element references directly from a HTML string
at github.com▼5 up and 1 down, posted by
5 up and 1 down, posted by
This is just a small utility function I found useful in some projects of mine... so I thought maybe you'll find it useful too. :-)
Hey there, many thx for your feedback! 1) That seemed like an obvious approach at first... but then again there's nothing particular about the interpolation process, so you'd actually just end up reimplementing the default behaviour. Also, it would be more awkward to pass in (or not to pass in) an options object... I'll have a look at allowing both though! 2) That sounds like a nice idea! But wouldn't the regular html-loader to the trick as well? const fromHTML = require('from-html') const template = require('./template.html') const { something } = fromHTML(template)