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

abt-omni-query-panel

v2.0.1

Published

Modern, Secure, Backend-Agnostic Configuration Panel

Downloads

12

Readme

AbtOmniQueryPanel (V2)

A modern, secure, and backend-agnostic configuration panel for your applications.

Features

  • Framework Agnostic: Built with Vanilla JS, works with any framework (React, Vue, Angular, etc.) or no framework.
  • Backend Agnostic: Connects to any backend via simple onSave and onLoad callbacks.
  • Secure: Built-in client-side AES-GCM encryption.
  • Modern UI: Clean, "Glassmorphism" design with dark/light mode support.
  • i18n Support: Built-in RTL/LTR support (English/Hebrew).

Installation

via CDN

<link rel="stylesheet" href="https://cdn.example.com/abt-omni-query-panel/main.css">
<script type="module" src="https://cdn.example.com/abt-omni-query-panel/AbtOmniQueryPanel.js"></script>

Local Setup

  1. Clone the repository.

2. Module Implementation (Recommended)

You can also keep your JavaScript logic in a separate file.

index.html:

<div id="abt-omni-query-panel"></div>
<script type="module" src="./init-panel.js"></script>

init-panel.js:

import AbtOmniQueryPanel from './src/AbtOmniQueryPanel.js';

const panel = new AbtOmniQueryPanel({
    container: document.getElementById('abt-omni-query-panel'),
    // ... options
});

See example-module.html and example-module.js for a complete working example.

3. CDN Usage (Future)

Once published, you can import directly from a CDN:

import AbtOmniQueryPanel from 'https://cdn.jsdelivr.net/npm/abt-omni-query-panel/src/AbtOmniQueryPanel.js';
  1. Include the files in your project.

Usage

import AbtOmniQueryPanel from './src/AbtOmniQueryPanel.js';

const panel = new AbtOmniQueryPanel({
    container: document.getElementById('my-panel-container'),
    theme: 'light', // 'light' or 'dark'
    language: 'en', // 'en' or 'he'
    encryptionKey: 'my-secret-key', // Optional: Enable encryption
    
    // Callback to load initial configuration
    onLoad: async () => {
        const response = await fetch('/api/config');
        return await response.json();
    },
    
    // Callback to save configuration
    onSave: async (config) => {
        await fetch('/api/config', {
            method: 'POST',
            body: JSON.stringify(config)
        });
    }
});

Running the Demo

  1. Start the test server:
    node server/server.js
  2. Open your browser to: http://localhost:5174

API Reference

new AbtOmniQueryPanel(options)

| Option | Type | Default | Description | | :--- | :--- | :--- | :--- | | container | HTMLElement | null | Required. The DOM element to render the panel into. | | theme | String | 'light' | 'light' or 'dark'. | | language | String | 'en' | 'en' (LTR) or 'he' (RTL). | | encryptionKey | String | null | If provided, data will be encrypted before onSave and decrypted after onLoad. | | onLoad | Function | null | Async function that returns the configuration object. | | onSave | Function | null | Async function that receives the configuration object (encrypted if key provided). |

Methods

  • panel.setTheme('dark'): Switch theme.
  • panel.setLanguage('he'): Switch language.
  • panel.save(): Trigger the save process manually.

Security & Injection Prevention

To prevent SQL Injection, NEVER concatenate user input directly into your queries. The AbtOmniQueryPanel allows users to define parameters separately from the query logic.

Backend Implementation Example (PHP/PDO)

When you receive the configuration:

$config = json_decode($request_body, true);

// 1. Source Tab Example
if ($config['source'] === 'table') {
    $sql = "SELECT * FROM " . preg_replace('/[^a-zA-Z0-9_]/', '', $config['tableName']);
    
    if (!empty($config['where'])) {
        $sql .= " WHERE " . $config['where']; // 'where' string should use :placeholders
    }
    
    $stmt = $pdo->prepare($sql);
    
    // Bind parameters defined in 'whereParams'
    if (!empty($config['whereParams'])) {
        $params = json_decode($config['whereParams'], true);
        foreach ($params as $key => $value) {
            $stmt->bindValue(":$key", $value);
        }
    }
    
    $stmt->execute();
}

// 2. Custom Query Example
if ($config['source'] === 'query') {
    $stmt = $pdo->prepare($config['customQuery']); // Query should use :placeholders
    
    if (!empty($config['queryParams'])) {
        $params = json_decode($config['queryParams'], true);
        foreach ($params as $key => $value) {
            $stmt->bindValue(":$key", $value);
        }
    }
    
    $stmt->execute();
}

Backend Query Builder

For backend implementations, use the queryBuilder utility to convert parameterized queries into executable SQL:

import { buildQuery, validateParameters } from 'abt-omni-query-panel/utils/query-builder';

// Received from the panel
const config = {
    customQuery: "SELECT * FROM users WHERE id IN (:auto_p1, :auto_p2) AND name = :auto_p3",
    queryParams: { auto_p1: 10, auto_p2: 20, auto_p3: "John" }
};

// Validate parameters
const validation = validateParameters(config.customQuery, config.queryParams);
if (!validation.valid) {
    console.error("Missing parameters:", validation.missingParams);
    return;
}

// Build executable query
const executableQuery = buildQuery(config.customQuery, config.queryParams);
// Result: "SELECT * FROM users WHERE id IN (10, 20) AND name = 'John'"

Note: The buildQuery function is for debugging/logging purposes. For production, use your database library's native parameter binding (PDO, mysqli_prepare, etc.) for maximum security.

Advanced Parameter Usage

The panel automatically parameterizes SQL queries to prevent injection attacks. String literals and numeric values are converted to parameters on save.

1. IN Operator

Standard prepared statements do not support arrays directly. You must handle this in your backend logic.

Panel Configuration:

  • Where/Query: id IN (:...ids) (or just a placeholder like :ids if your backend handles expansion)
  • Parameters: {"ids": [1, 2, 3]}

Backend Implementation (PHP Example):

if (isset($params['ids']) && is_array($params['ids'])) {
    // Create placeholders like :ids_0, :ids_1, :ids_2
    $placeholders = [];
    foreach ($params['ids'] as $i => $val) {
        $placeholders[] = ":ids_$i";
        $flatParams["ids_$i"] = $val;
    }
    // Replace :ids in the SQL with the list of placeholders
    $sql = str_replace(':ids', implode(',', $placeholders), $sql);
}

2. BETWEEN Operator

Use two separate parameters.

Panel Configuration:

  • Where/Query: created_at BETWEEN :startDate AND :endDate
  • Parameters: {"startDate": "2023-01-01", "endDate": "2023-12-31"}

3. LIKE Operator

Include the wildcards % in the parameter value, not the query.

Panel Configuration:

  • Where/Query: name LIKE :nameSearch
  • Parameters: {"nameSearch": "%John%"}