Security News
cURL Project and Go Security Teams Reject CVSS as Broken
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.
select-dom
Advanced tools
Lightweight
querySelector
/All
wrapper that outputs an Array
Version 5+ only supports browsers with Set
support. If you need IE 10- support, stick to select-dom@4
$ npm install select-dom
const select = require('select-dom')
select()
select('.foo a[href=bar]')
// => <Element>
select('.foo a[href=bar]', baseElement)
// => <Element>
select.exists()
select.exists('.foo a[href=bar]')
// => true/false
select.exists('.foo a[href=bar]', baseElement)
// => true/false
select.all()
select.all('.foo a[href=bar]')
// => [<Element>, <Element>, <Element>]
select.all('.foo a[href=bar]', baseElement)
// => [<Element>, <Element>, <Element>]
select.all('.foo a[href=bar]', [baseElement1, baseElement2])
// => [<Element>, <Element>, <Element>]
Note: if a falsy value is passed as baseElement
, you'll always get an empty result (bd578b9)
select(selector[, baseElement = document])
Maps to baseElement.querySelector(selector)
select.exists(selector[, baseElement = document])
Tests the existence of one or more elements matching the selector.
select.all(selector[, baseElements = document])
Maps to baseElements.querySelectorAll(selector)
plus:
This lets you search through an existing list of elements, like:
const baseElements = select.all('.baseElements').filter(Math.random);
select.all('.foo a[href=bar]', baseElements);
FAQs
Extra lightweight DOM selector helper
The npm package select-dom receives a total of 170 weekly downloads. As such, select-dom popularity was classified as not popular.
We found that select-dom demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
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.
Security News
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.
Security News
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.
Security News
Biden's executive order pushes for AI-driven cybersecurity, software supply chain transparency, and stronger protections for federal and open source systems.