Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
:rotating_light::rotating_light::rotating_light:
This fork exists solely to prevent the parser from infinitely looping when an invalid expression is parsed such as:
slick.parse('()')
:rotating_light::rotating_light::rotating_light:
Slick is a standalone selector engine that is totally slick. Slick is split in 2 components: the Finder and the Parser. The Finder's job is to find nodes on a webpage, the Parser's job is to create a javascript object representation of any css selector.
Slick allows you to:
Find nodes in the DOM
search
context for selectorSearch this context for any nodes that match this selector.
Expects:
Returns: append argument or Array of 0 or more nodes
slick.search("#foo > bar.baz") → [<bar>, <bar>, <bar>]
slick.search("li > a", [<ol>, <ul>]) → [<a>, <a>, <a>]
slick.search("#foo > bar.baz", document, []) → [<bar>, <bar>, <bar>]
find
first in context with selector or nullFind the first node in document that matches selector or null if none are found.
Expects:
Returns: Element or null
slick.find("#foo > bar.baz") → <bar>
slick.find("#does-not-exist", node) → null
matches
selector?Does this node match this selector?
Expects:
Returns: true or false
slick.matches(<div class=rocks>, "div.rocks") → true
slick.matches(<div class=lame>, "div.rocks") → false
slick.matches(<div class=lame>, <div class=rocks>) → false
contains
node?Does this context contain this node? Is the context a parent of this node?
Expects:
Returns: true or false
slick.contains(<ul>, <li>) → true
slick.contains(<body>, <html>) → false
Parse a CSS selector string into a JavaScript object
parse
selector into objectParse a CSS Selector String into a Selector Object.
Expects: String
Returns: SelectorObject
slick.parse("#foo > bar.baz") → SelectorObject
#foo > bar.baz
[[
{ "combinator":" ", "tag":"*", "id":"foo" },
{ "combinator":">", "tag":"bar", "classList": ["baz"], "classes": [{"value":"baz", "match": RegExp }]}
]]
h1, h2, ul > li, .things
[
[{ "combinator":" ", "tag": "h1" }],
[{ "combinator":" ", "tag": "h2" }],
[{ "combinator":" ", "tag": "ul" }, { "combinator": ">", "tag": "li" }],
[{ "combinator":" ", "tag": "*", "classList": ["things"], "classes": [{"value": "things", "match": RegExp }] }]
]
FAQs
Standalone CSS Selector Finder and Parser.
The npm package atom-slick receives a total of 163 weekly downloads. As such, atom-slick popularity was classified as not popular.
We found that atom-slick demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.