Sizzle Documentation

repository·main·Indexed 27 days ago

https://github.com/jquery/sizzle

A pure-JavaScript, bottom-up CSS selector engine designed to be easily dropped into a host library, providing robust and high-performance CSS selector matching.

Tokens
379
Snippets
3
Records
4
Agent score
42%

What's inside Sizzle

  1. Build Sizzle from source

    main

    To build Sizzle, ensure you have the latest Node.js/npm and git (1.7 or later) installed.

    1. Clone the repository:
    git clone git@github.com:jquery/sizzle.git
    1. The built versions, including minified copies and source maps, are located in the sizzle/dist folder.
  2. Run Sizzle tests

    main

    To run tests, first install dependencies using npm install. It is also recommended to have grunt-cli installed globally (npm install -g grunt-cli).

    You can run tests in two ways:

    1. Command Line: Run npm test or grunt test. If BROWSER_STACK_USERNAME and BROWSER_STACK_ACCESS_KEY environment variables are set, it will attempt to use Browserstack; otherwise, it defaults to PhantomJS.
    2. Browser: Open test/index.html directly in a browser.

    Unit tests are located in the test/unit directory.

    npm install
    npm test
    # or
    grant test
  3. Develop with Grunt

    main

    Sizzle uses Grunt for development tasks. Use the following commands to manage the build and development workflow:

    • npm run build or grunt: Lints, builds, tests, and compares the sizes of the built files.
    • npm start or grunt start: Re-lints, re-builds, and re-tests files as they change.
    • grunt -help: Displays all available Grunt commands.
    npm run build
    npm start