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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@dbforge/framework

v0.3.2

Published

DBForge client framework with AES-256 encryption, SQL protection, TypeScript support and dual public/authorized API modes.

Downloads

166

Readme

DBForge Framework

Custom lightweight framework that lets you interact with DBForge-managed databases using:

  1. API tokens (no DB credentials required) – uses the DBForge REST API (including the public token endpoints) to run SQL queries securely.
  2. Connection strings – connect directly to MySQL/MariaDB or PostgreSQL using native drivers (mysql2, pg).
  3. Credentials – specify host/port/username/password/database manually if you prefer explicit config.

On top of the connection helpers, the framework exposes simple CRUD helpers and ships with a small visualization playground so users can test API-token-based queries in the browser.

Structure

framework/
├─ package.json
├─ README.md
├─ src/
│  ├─ client.js           # Node/CLI version (supports API token + direct SQL connections)
│  └─ browser-client.js   # Browser-friendly API-token client used by the playground
└─ ui/
   ├─ index.html          # interactive playground (API-token mode)
   ├─ app.js
   └─ styles.css

Installation

cd framework
npm install

Node Usage

import { DbForgeClient } from './src/client.js';

// API token
const apiClient = DbForgeClient.fromApiToken({
  apiUrl: 'http://192.168.0.107:8080/api',
  apiToken: 'dfg_live_…',
});
await apiClient.connect();
const result = await apiClient.select('users', { limit: 5 });

// Connection string
const connClient = DbForgeClient.fromConnectionString(
  'mysql://user:pass@localhost:3306/example',
);
await connClient.connect();
await connClient.insert('users', { name: 'Jane', email: '[email protected]' });

// Credentials
const credClient = DbForgeClient.fromCredentials({
  dbType: 'postgresql',
  host: 'localhost',
  username: 'postgres',
  password: 'secret',
  database: 'sample',
});
await credClient.connect();
await credClient.delete('users', { email: '[email protected]' });

CRUD Helpers

  • select(table, { columns, where, limit, orderBy })
  • insert(table, dataObject)
  • update(table, dataObject, where)
  • delete(table, where) – requires a where to prevent accidental truncation.

Browser Playground

Open framework/ui/index.html via any static server (or use Live Server in VSCode). It imports src/browser-client.js, so the UI currently supports API-token mode—ideal for quickly testing CRUD workflows with DBForge-managed instances. For direct connection strings or username/password flows, use the Node version (src/client.js).

Notes

  • Direct connections currently support MySQL/MariaDB and PostgreSQL via mysql2 and pg.
  • API-token mode uses the public endpoints whenever possible and transparently falls back to the authenticated /databases/{id}/query path when necessary.
  • CRUD helpers string-build SQL. For untrusted user input, consider parameterized statements via client.query().