Skip to content

heapwolf/qs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 

Repository files navigation

SYNOPSIS

A minimal query selector helper library.

INSTALL

npm install heapwolf/qs

API

There are only two methods, qs and qsa.

qs is a short function that assumes document, but can take an optional additional parameter that will specify scope of the selector's execution.

const qs = (s, p) => (p || document).querySelector(s)

qsa is the same as above, but uses .querySelectorAll and will also convert the NodeList into an array, providing at least an empty array if there are no nodes found.

const qsa = (s, p) => [...(p || document).querySelectorAll(s)]
module.exports = { qs, qsa }

About

A minimalist dom library

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published