npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

qdom-js

v1.0.5

Published

QDOM JS - DOM Manipulation with SQL-like syntax

Downloads

21

Readme

QDOM JS - DOM Manipulation with SQL-like syntax

QDOM JS is a JavaScript library for SQL-like DOM manipulation. It provides an intuitive interface for interacting with the DOM in a way that mimics SQL syntax, such as SELECT, INSERT, UPDATE, DELETE, and other commands for efficient DOM manipulation.

This package is designed for developers with some knowledge of JavaScript, enabling them to interact with DOM elements more effectively using SQL-like syntax.

QDOM JS uses:

🔥 Features

  • ⚡ Lightweight (only ~36 KB)
  • 🎯 Pure client-side execution
  • ✨ SQL-like syntax for DOM manipulation
  • 🧩 Easy integration into any project via a <script> tag
  • 🔒 Protection against XSS when inserting HTML

🚀 Installation

Import QDOM JS into the HTML file

If you're using it in a project with a <script> tag, you can include the minified version directly:

<script src="https://cdn.jsdelivr.net/npm/qdom-js/dist/qdom.min.js"></script>

⚙️ Usage

Basic DOM Operations

Once you include the library in your project, you can use the available commands to manipulate the DOM.

1. SELECT

To select an element and perform an operation on it:

QDOM.select('#elementId').count('*');
QDOM.select('.container').sum('.value');

SELECT only allows applying aggregation functions, not directly selecting elements as that can be done with CSS selectors. SELECT supports COUNT, SUM, AVG, MIN and MAX operations. Both SELECT and DELETE support * selector alongside with normal CSS selectors.

2. INSERT

To insert content into a DOM element:

QDOM.insert('<div><span>Test</span></div>').into('#elementId');

3. UPDATE

To update the properties of an element:

QDOM.update('#elementId').set({ text: 'New Text' });
QDOM.update('#header').set({ html: '<div>Hello!</div>' });

Note: UPDATE allows for text property which sets the innerText property to the given value, and for html property which sets the innerHTML property to the given value. The rest of the properties are taken for granted and don't present any special rules (color, fontSize, etc.).

4. DELETE

To delete a DOM element:

QDOM.delete('#elementId').from('body');
QDOM.delete('*').from('.list');

5. DROP

To drop an element from the DOM:

QDOM.drop('#elementId');

6. CREATE TRIGGER

To create a trigger for DOM operations:

QDOM.createTrigger('click')
	.on('#buttonId')
	.execute(() => {
		console.log('Button clicked');
	});

7. EXECUTE TRIGGER

To manually execute a trigger:

QDOM.executeTrigger('click').on('#buttonId');

📚 API

The core methods provided by QDOM JS are:

  • select(selector) - Select elements based on the given selector for which to apply later defined functions (such as COUNT).
  • insert(content) - Insert HTML content into selected elements.
  • update(selector) - Update properties of the selected elements.
  • delete(selector) - Delete elements from the DOM.
  • drop(selector) - Drop an element from the DOM.
  • createTrigger(event) - Create a trigger on an element.
  • executeTrigger(event) - Execute a trigger manually.

Each of these methods returns a chainable object that can be used for further operations (like in the create trigger example).