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

@argos-js/argosdb

v0.1.3

Published

Native TypeScript Client for ArgosDB with zero dependencies, type-safe schema & query builders, and native ID triad (UUIDV7, ULID, SQID) support

Readme

@argos-js/argosdb

Official, zero-dependency, lightweight, and type-safe native TypeScript client for ArgosDB (argosdb-server).

@argos-js/argosdb provides a seamless developer experience (DX) designed specifically for ArgosDB. It operates completely independently of other database engines (no PostgreSQL, no SQLite, no heavy ORM abstractions) and natively embraces ArgosDB's Native ID Triad (UUIDV7, ULID, SQID).


🚀 Key Features

  • Zero Runtime Dependencies: Built purely on modern JavaScript and Node.js primitives with zero third-party packages.
  • Native ID Triad Support: Built-in expressions and automatic defaults for UUIDV7(), ULID(), and SQID().
  • Transparent Data Encryption (TDE): Native master key and TDE authorization token propagation (Authorization: Bearer <token>, X-Argos-Master-Key, X-TDE-Token).
  • Decorator-Free Schema Builder: Clean, lightweight table definition with .notNull(), .primaryKey(), .default(), .defaultNow(), and .unique().
  • Strict Compile-Time Type Inference: Full TypeScript inference for query results and insert payloads (InferSelectModel, InferInsertModel).
  • Fluent, Awaitable Query Builder: Directly await query builders for SELECT, INSERT, UPDATE, and DELETE statements without boilerplate.
  • Built-in Connection Pooling: Concurrency-bounded connection queue with support for both HTTP and TCP transports.
  • Rich Diagnostics: Preserves visual multi-line server compiler errors, caret diagnostics, and contextual hints via ArgosDBError.

📦 Installation

pnpm add @argos-js/argosdb

⚡ Quickstart & Usage

import { ArgosDB, table, string, timestamp, eq } from '@argos-js/argosdb';

// 1. Initialize client with server endpoint and master key
const db = new ArgosDB({
  endpoint: 'http://127.0.0.1:8787',
  masterKey: process.env.ARGOS_MASTER_KEY,
  database: 'default',
});

// 2. Define schema with Native ID defaults
export const usuarios = table('usuarios', {
  id: string().primaryKey().default('SQID()'),
  nome: string().notNull(),
  email: string().notNull(),
  criadoEm: timestamp().defaultNow(),
});

// 3. Execute queries seamlessly
async function main() {
  // Insert with omitted ID (automatically generated by ArgosDB SQID engine)
  await db.insert(usuarios).values({
    nome: 'André',
    email: '[email protected]',
  });

  // Query records with full type inference
  const results = await db.select().from(usuarios);
  console.log(results);

  // Filtered queries
  const user = await db
    .select()
    .from(usuarios)
    .where(eq(usuarios.email, '[email protected]'));

  console.log('User:', user[0]);
}

main().catch(console.error);

🔑 Native ID Triad (UUIDV7, ULID, SQID)

ArgosDB includes high-performance monotonic identifier generators within its storage and query engine. @argos-js/argosdb exposes direct helpers for table schemas and queries:

import { table, uuidv7, ulid, sqid, string, UUIDV7, ULID, SQID, ids } from '@argos-js/argosdb';

export const events = table('events', {
  // Built-in column triad helpers:
  v7: uuidv7().primaryKey(),    // Generates UUIDV7 PRIMARY KEY DEFAULT UUIDV7()
  ul: ulid().notNull(),         // Generates ULID NOT NULL DEFAULT ULID()
  sq: sqid().notNull(),         // Generates VARCHAR NOT NULL DEFAULT SQID()

  // Or manual expression assignment:
  customV7: string().default(UUIDV7()),
  customUlid: string().default(ULID()),
  customSqid: string().default(SQID(1000)),
  constantSqid: string().default(ids.SQID),
});

🛠️ Query Builder Reference

INSERT

// Single insert
await db.insert(usuarios).values({
  nome: 'Alice',
  email: '[email protected]',
});

// Batch insert
await db.insert(usuarios).values([
  { nome: 'Bob', email: '[email protected]' },
  { nome: 'Carol', email: '[email protected]' },
]);

// With RETURNING clause
const inserted = await db.insert(usuarios)
  .values({ nome: 'Dave', email: '[email protected]' })
  .returning('*');

SELECT

// Select all columns
const allUsers = await db.select().from(usuarios);

// Select specific columns
const partial = await db
  .select({ id: usuarios.id, email: usuarios.email })
  .from(usuarios);

// Conditions & Ordering
import { eq, gt, and, or, asc, desc } from '@argos-js/argosdb';

const filtered = await db
  .select()
  .from(usuarios)
  .where(
    or(
      eq(usuarios.nome, 'André'),
      and(gt(usuarios.id, '100'), eq(usuarios.email, '[email protected]'))
    )
  )
  .orderBy(desc(usuarios.criadoEm), asc(usuarios.id))
  .limit(20)
  .offset(0);

UPDATE

await db.update(usuarios)
  .set({ nome: 'André M.' })
  .where(eq(usuarios.email, '[email protected]'));

DELETE

await db.delete(usuarios)
  .where(eq(usuarios.email, '[email protected]'));

🛡️ Health & Metrics Telemetry

// Health probe
const health = await db.health();
console.log(`Server status: ${health.status}, version: ${health.version}`);

// OpenMetrics & runtime telemetry
const metrics = await db.metrics();
console.log(`Active connections: ${metrics.active_connections}`);
console.log(`Storage bytes: ${metrics.storage_bytes}`);
console.log(`Total queries processed: ${metrics.total_queries}`);

🧪 Testing

pnpm --filter "@argos-js/argosdb" test

📄 License

MIT © Argos Development Team