Socket
Socket
Sign inDemoInstall

query-selector

Package Overview
Dependencies
0
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    query-selector

javascript implementation of querySelectorAll


Version published
Maintainers
1
Install size
376 kB
Created

Readme

Source

query-selector


querySelectorAll in javascript

query-selector NPM downloads Build Status Coverage Status

use on node

require jsdom

var querySelectorAll = require('query-selector');
var jsdom = require("jsdom").jsdom;
var doc = jsdom('<html><div id="t"><span>1</span><span>2</span></div></html>');
var time = Date.now();
console.log(doc.querySelectorAll('#t span', doc).length);
console.log(doc.querySelectorAll('#t span', doc)[0].innerHTML);
console.log(Date.now()-time);
time = Date.now();
console.log(querySelectorAll('#t span', doc).length);
console.log(querySelectorAll('#t span', doc)[0].innerHTML);
console.log(Date.now()-time);

use standalone on browser

<script src="/build/query-selector-standalone-debug.js"></script>
<div id="t">
    <span>1</span>
    <span>2</span>
</div>
<script>
    console.log(querySelectorAll('#t span'));
</script>

FAQs

Last updated on 14 Aug 2019

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc