Skip to content

m3g4p0p/qutility

Repository files navigation

qutility

Minimalistic DOM query utility.

Installation

yarn add qutility

Usage

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.

Todo

  • Accept a context argument for elements and collections as well
  • Accept a selector string as the context argument

License

MIT 2018

About

Minimalist DOM query utility

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages