querySelectorAll selector engine

npm install scan
1 downloads in the last week
38 downloads in the last month


scan is a querySelectorAll-based selector engine designed for standalone use or integration into jQuery-like libraries like ender.

npm: scan

API (0.7)


scan(query, context?)

  • scan(selector) → elements that match selector
  • scan(selector, node|nodes) → elements that match selector from node or any nodes
  • scan(node|nodes) → array


scan.matches(element, selector) → boolean


scan.contains(haystack, needle, start?) → boolean

  • scan.contains(node, element)true if node contains element
  • scan.contains(stack, item, start?)true if stack contains item
  • scan.contains(str, substr, start?)true if str contains substr


scan.find(query, context?)

scan.find(stack, fn, scope?)


  •, selector) → descendants that match selector
  •, element|elements)elements that descend from any nodes
  •, fn, scope?) → same as scan.find(stack, fn, scope?)



  •, selector)nodes filtered by selector
  •, fn)nodes filtered by, i)
  •, element|elements)nodes filtered by element|elements



  •, selector)nodes filtered against selector
  •, fn)nodes filtered against, i)
  •, element|elements)nodes filtered against element|elements


Selector queries use querySelectorAll where available or else degrade to getElementsByTagName.


Contribute by making edits in /src or reporting issues.

$ npm install
$ grunt jshint:src


Tip the developer =)



npm loves you