Minimalistic DOM query utility.
yarn add qutility
Basically forwards elements, collections, or collections from selector strings (+ optional context) to Array.from()
. Like this or something:
import q from 'qutility'
const metaContent = q('meta', document.head, el => el.content).join('\n')
q('section')
.flatMap(el => q('.meta-content', el))
.forEach(el => {
el.textContent = metaContent
})
Please have a look at the specs for details.
- Accept a context argument for elements and collections as well
- Accept a selector string as the context argument
MIT 2018