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

@semantq/semantqql

v1.0.0

Published

CRUD abstraction module for SemantQL

Downloads

16

Readme

semantqQL

CRUD Abstraction for Semantq Full Stack Apps (semantqQL)

A super lightweight, robust, and reusable JavaScript HTTP client class that abstracts standard CRUD (Create, Read, Update, Delete) operations with simple fetch API calls — designed to streamline REST API interactions in your full-stack SemantQL projects.

Installation

Install via npm:

npm install @semantq/ql

Import it into your project:

import smQL from '@semantq/ql';

Usage

Create an instance with the endpoint URL, HTTP method, request body (if any), and optional configuration:

const result = await new smQL(endpoint, method, body, options);
  • endpoint: URL string of your API resource

  • method: HTTP method string (GET, POST, PUT, PATCH, DELETE) — defaults to GET

  • body: Request payload for methods like POST or PUT (default: null)

  • options: Optional configuration object — supports:

    • headers — additional headers
    • log — boolean to enable/disable automatic console logging (default: true)

Automatic Logging

By default, semantQL.js automatically logs success or failure messages to the console for every request, showing HTTP method, status, and response data.

You do not need to manually log responses in your application code unless you disable logs explicitly:

await new smQL('http://localhost:3003/product/products', 'GET', null, { log: false });

Returned Result Object

The promise resolves to an object containing:

{
  status: number,       // HTTP status code
  ok: boolean,          // true if response.ok (status 2xx)
  data: any,            // Parsed JSON or plain text response body
  error?: string        // Error message if request failed
}

You can use this object directly without needing extra logging.

Examples: Common CRUD Operations

1. GET — Fetch all products

const data = await new smQL('http://localhost:3003/product/products');

//now you can do: console.log(data); 

2. POST — Create a new category

const newCategory = { name: 'Mobiles' };

const response = await new smQL('http://localhost:3003/category/categories', 'POST', newCategory);

3. PUT — Update an existing category

const updatedCategory = { name: 'Mobile Phones' };
const categoryId = 7;

const response = await new smQL(`http://localhost:3003/category/categories/${categoryId}`, 'PUT', updatedCategory);

4. DELETE — Delete a product (without logs)

const productId = 42;

const response = await new smQL(`http://localhost:3003/product/products/${productId}`, 'DELETE', null, { log: false });

Why Use semantQL.js?

This class serves as a simple CRUD abstraction layer within the full-stack SemantQL setup, allowing you to:

  • Write clean, concise API calls without repeating boilerplate
  • Handle JSON payloads and errors uniformly
  • Have automatic logging out-of-the-box with the option to disable per request
  • Plug and play with any REST API endpoint

It’s lightweight and designed with developer experience in mind.

Happy CRUDing. !!!

License

Semantq is open-source software licensed under the MIT License.

Semantq Main Documentation: Semantq.