Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

queried

Package Overview
Dependencies
Maintainers
1
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

queried

Query selector CSS4 +

  • 1.4.5
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

queried Build Status Code Climate

Queried is a convenient wrapper for querySelector.

  1. query-compliant API.

  2. Returns Array instead of NodeList in multiple query: q.all('.block').forEach(function (el) { ... } ).

  3. Accepts other elements or array as a selector: q.all(['.block', self.el]);.

  4. Polyfills CSS3 & CSS4 pseudos: :has, :scope, :root, :matches.

  5. Fixes immediate children selector > *: q.all('> *', element);.

  6. Normalizes nested :not’s: :not(a:not(:target)).

Usage

npm install queried

var q = require('queried');

//select each div having `a` with `span` inside as immediate children.
q.all('div:has(a:has(span))');

API

MethodDescription
query(selector, el=document)Query a single element by selector
query.all(selector, el=document)Query list of elements by selector
query.documentDefault document to use. Change it, if you need custom DOM, like q.document = require('dom-lite').document.

Similar

FAQs

Package last updated on 21 Oct 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc