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

@kemetsoft/ankhdb-js

v2.0.2

Published

The official JavaScript SDK for AnkhDB - Real-time Multi-tenant BaaS.

Readme

@kemetsoft/ankhdb-js

npm version

The official JavaScript / TypeScript SDK for AnkhDB — a self-hosted, multi-tenant Backend-as-a-Service with Auth, Database, Storage, and Edge Functions.

Installation

npm install @kemetsoft/ankhdb-js

Quick Start

Find your Project ID and API Key in the AnkhDB Dashboard → Settings.

import AnkhDB from '@kemetsoft/ankhdb-js';

const db = new AnkhDB('YOUR_PROJECT_ID', 'YOUR_API_KEY');
// Self-hosted: new AnkhDB('proj_...', 'ankh_sec_...', { serverUrl: 'http://localhost:5000' })

Error Handling

All errors throw typed exceptions derived from AnkhDBError:

import { AuthError, NotFoundError, RateLimitError } from '@kemetsoft/ankhdb-js';

try {
  await db.login('[email protected]', 'wrong');
} catch (err) {
  if (err instanceof AuthError)      console.log('Bad credentials');
  if (err instanceof RateLimitError) console.log('Slow down!');
  console.log(err.status, err.message);
}

| Class | HTTP Status | |---|---| | AnkhDBError | base (all errors) | | ValidationError | 400 | | AuthError | 401 | | PermissionError | 403 | | NotFoundError | 404 | | RateLimitError | 429 | | ServerError | 5xx |


Authentication

await db.register('[email protected]', 'password');
await db.login('[email protected]', 'password');
const { user } = await db.getSession();
db.logout();

Database — Query Builder

db.from(collection) returns a chainable AnkhQuery:

const posts = db.from('posts');

// Basic CRUD
const doc  = await posts.insert({ title: 'Hello', views: 0 });
const all  = await posts.select();
const one  = await posts.get(doc.id);
await posts.update(doc.id, { views: 1 });
await posts.delete(doc.id);

// Filters
const popular = await db.from('posts')
  .gt('views', 100)
  .eq('status', 'published')
  .select();

// Pagination
const page2 = await db.from('posts').limit(10).offset(10).select();

// Join (embed related collection)
const withComments = await db.from('posts')
  .join('comments', 'postId')   // embed comments where comments.postId === post.id
  .select();

// Realtime subscription
const es = db.from('posts').subscribe((event) => {
  console.log(event.event, event.data); // INSERT / UPDATE / DELETE
});
// es.close() to unsubscribe

Storage

const file     = document.querySelector('input[type=file]').files[0];
const uploaded = await db.storage.upload(file);
console.log(uploaded.url);

const files = await db.storage.list();
await db.storage.delete(uploaded.id);

Edge Functions

const res = await db.functions.invoke('greet', { name: 'Alice' });
console.log(res.result);

API Reference

| Method | Description | |---|---| | new AnkhDB(projectId, apiKey, options?) | Create a client | | db.from(collection) | Get an AnkhQuery builder | | query.eq/neq/gt/gte/lt/lte(field, val) | Add a filter | | query.limit(n) / query.offset(n) | Paginaton | | query.join(col, fkField) | Embed related docs | | query.select() | Fetch documents | | query.insert(data) | Create a document | | query.update(id, data) | Update a document | | query.delete(id) | Delete a document | | query.subscribe(cb) | SSE realtime stream | | db.storage.upload(file) | Upload a file | | db.storage.list() | List files | | db.storage.delete(id) | Delete a file | | db.functions.invoke(name, payload?) | Call an Edge Function |


License

MIT © KemetSoft