Registry / web-framework / slick
library1.0jsnpmunverified

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.

npm install slick
INSTALL
IMPORT
SIG · SLICK
S
slick
web-frameworkjavascriptv1.0
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

slick
const slick = require('slick')
import slick from 'slick'
The package is a CommonJS module and does not officially support ESM `import` statements. The entire module's functionality is exposed via a single `slick` object.
search
const slick = require('slick'); slick.search(...)
import { search } from 'slick'
The `search` function is a method on the `slick` object exported by the CommonJS module. It is not available as a named ESM export.
parse
const slick = require('slick'); slick.parse(...)
import { parse } from 'slick'
The `parse` function is a method on the `slick` object exported by the CommonJS module. It is not available as a named ESM export.

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.

const { JSDOM } = require('jsdom'); const slick = require('slick'); // Setup a simple DOM environment for demonstration const dom = new JSDOM(` <!DOCTYPE html> <html> <body> <div id="container"> <ul class="list"> <li>Item 1</li> <li class="active">Item 2</li> </ul> <p>A paragraph</p> <ul class="list"> <li>Another Item</li> </ul> </div> </body> </html> `); const document = dom.window.document; console.log('--- Using slick.parse ---\n'); const selectorObject = slick.parse('ul.list > li.active'); console.log('Parsed Selector Object:', JSON.stringify(selectorObject, null, 2)); console.log('\n--- Using slick.search ---\n'); const foundElements = slick.search('ul.list > li.active', document); console.log('Found Elements:', foundElements.map(el => el.outerHTML)); console.log('\n--- Using slick.find ---\n'); const firstFoundElement = slick.find('li:first-child', document); console.log('First Found Element:', firstFoundElement ? firstFoundElement.outerHTML : 'None'); console.log('\n--- Using slick.matches ---\n'); const targetElement = document.querySelector('.active'); const matches = slick.matches(targetElement, 'li.active'); console.log(`Does <li class="active"> match 'li.active'? ${matches}`);
Debug
Known issues
breakingThe `slick` project appears to be abandoned, with no updates or commits in over nine years. This means there will be no bug fixes, performance improvements, or security patches for any discovered vulnerabilities.
fix
Consider migrating to modern, actively maintained CSS selector engines or utilizing native DOM APIs like `document.querySelector` and `document.querySelectorAll`, which are widely supported, performant, and secure.
affects: >=1.12.2
gotchaSlick is a CommonJS-only module and does not natively support ECMAScript Modules (ESM) `import` statements. Attempting to use `import` will likely result in module resolution errors or undefined behavior.
fix
Always use `const slick = require('slick')` for module loading in Node.js environments. If you must use it in an ESM context, you might need a transpilation step or a CommonJS wrapper.
affects: >=1.0.0
gotchaDue to its age, `slick` may not fully support modern CSS selectors (e.g., `:is()`, `:where()`, `:has()`) or might have compatibility issues with newer browser features or edge cases. Its performance might also lag behind native browser implementations.
fix
Thoroughly test `slick` in your target browser environments for selector compatibility and performance. For modern web development, relying on native `querySelector` and `querySelectorAll` is generally recommended.
affects: >=1.0.0
gotchaThe `slick` package does not provide TypeScript declaration files (`.d.ts`). Using it in a TypeScript project will result in type errors and lack of autocompletion without manual type declarations.
fix
You will need to create your own `slick.d.ts` declaration file to provide type information for the module and its methods if you are using TypeScript.
affects: >=1.0.0
Errors
Common errors & fixes
TypeError: slick.search is not a function
Attempting to call `slick.search` after an incorrect ESM import, or if `slick` was not properly assigned the module's export.
fix
Ensure you are importing the module correctly using `const slick = require('slick');` in a CommonJS environment.
ReferenceError: slick is not defined
Trying to access the `slick` object in a Node.js environment without explicitly importing it first, or assuming it's a global variable.
fix
Add `const slick = require('slick');` at the top of your JavaScript file to properly import and define the `slick` object.
SyntaxError: Named export 'search' not found...
Attempting to use named imports (e.g., `import { search } from 'slick'`) from the `slick` module. Slick is a CommonJS module that exports a single object, not named exports.
fix
Import the entire module as a single object using `const slick = require('slick');` and then access methods as properties, e.g., `slick.search()`.
Upgrade
Version history
1.0latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
8 hits · last 30 days
node
8
Resources
slick — npm install slick · libregistry