Skip to main content

Quick Start

Jelly SQL is a SQL-like language for querying the DOM. It allows you to generate CSS selectors using SQL syntax. See the quick start example for more information.

Getting Started​

Jelly SQL requires no third-party dependencies. You can use it in the browser or in Node.js. TypeScript is also supported.

Using npm or yarn​

Install​

npm install jelly-sql

Import & Use​

See the API documentation for more information, and the cheat sheet for a quick reference.

import { query } from 'jelly-sql';

const selector = query(`SELECT * FROM DOM WHERE TAG = 'a'`);
console.log(selector); // Output: "a"

Using a CDN (Browser)​

You can also use Jelly SQL in the browser by including the following script tag:

<script src="https://cdn.jsdelivr.net/npm/jelly-sql@latest/build/dist/jelly-sql.min.js"></script>

Usage​

This will expose the jellySQL object globally, which you can use to query the DOM. See the API documentation for more information, and the cheat sheet for a quick reference.

const selector = jellySQL.query(`SELECT * FROM DOM WHERE TAG = 'a'`);
console.log(selector); // Output: "a"