{"library":"slick","title":"Slick CSS Selector Engine","description":"Slick is a standalone JavaScript library designed for parsing CSS selectors into an object representation and finding DOM nodes based on those selectors. It provides a 'Finder' component for querying the DOM (with methods like `search` and `find`) and a 'Parser' component for converting CSS selector strings into a structured JavaScript object. The current stable version, 1.12.2, was released nine years ago, indicating the project is no longer actively maintained. Key differentiators include its ability to parse selectors into a detailed object, support for custom pseudo-classes, and functionality for searching within XML documents. Its primary use case is in environments where a lightweight, self-contained selector engine is required without external dependencies. This library predates modern browser native selector APIs and module systems, making it primarily a legacy solution.","language":"javascript","status":"abandoned","last_verified":"Tue Apr 21","install":{"commands":["npm install slick"],"cli":null},"imports":["const slick = require('slick')","const slick = require('slick'); slick.search(...)","const slick = require('slick'); slick.parse(...)"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"const { JSDOM } = require('jsdom');\nconst slick = require('slick');\n\n// Setup a simple DOM environment for demonstration\nconst dom = new JSDOM(`\n  <!DOCTYPE html>\n  <html>\n  <body>\n    <div id=\"container\">\n      <ul class=\"list\">\n        <li>Item 1</li>\n        <li class=\"active\">Item 2</li>\n      </ul>\n      <p>A paragraph</p>\n      <ul class=\"list\">\n        <li>Another Item</li>\n      </ul>\n    </div>\n  </body>\n  </html>\n`);\nconst document = dom.window.document;\n\nconsole.log('--- Using slick.parse ---\\n');\nconst selectorObject = slick.parse('ul.list > li.active');\nconsole.log('Parsed Selector Object:', JSON.stringify(selectorObject, null, 2));\n\nconsole.log('\\n--- Using slick.search ---\\n');\nconst foundElements = slick.search('ul.list > li.active', document);\nconsole.log('Found Elements:', foundElements.map(el => el.outerHTML));\n\nconsole.log('\\n--- Using slick.find ---\\n');\nconst firstFoundElement = slick.find('li:first-child', document);\nconsole.log('First Found Element:', firstFoundElement ? firstFoundElement.outerHTML : 'None');\n\nconsole.log('\\n--- Using slick.matches ---\\n');\nconst targetElement = document.querySelector('.active');\nconst matches = slick.matches(targetElement, 'li.active');\nconsole.log(`Does <li class=\"active\"> match 'li.active'? ${matches}`);","lang":"javascript","description":"This quickstart demonstrates how to use Slick in a Node.js environment. It shows how to initialize `slick` using CommonJS `require`, parse a CSS selector string into an object, and then use the `search`, `find`, and `matches` methods to query a simulated DOM structure provided by `jsdom`. The `jsdom` library is used here solely for demonstration purposes to create a browser-like DOM context within Node.js, and is not a dependency of `slick` itself.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}