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

@relbyte/http

v0.2.0

Published

Hono HTTP adapter for Relbyte — remote embedded database service

Readme

@relbyte/http

Hono tabanlı HTTP adaptörü — Relbyte'ı hafif bir uzaktan gömülü veritabanı servisi olarak sunar.

Hono taşımayı yönetir; Relbyte veritabanı semantiğini yönetir. Core paketinde HTTP bağımlılığı yoktur.

Kurulum

npm install @relbyte/core @relbyte/http hono
# Node.js sunucusu için (opsiyonel):
npm install @hono/node-server

Temel kullanım

import { Relbyte } from '@relbyte/core';
import { createRelbyteApp } from '@relbyte/http';
import { listenNode } from '@relbyte/http/node.js';

const db = await Relbyte.open('./app.relbyte');

const app = createRelbyteApp({ db });

// Node.js
const server = await listenNode(app, { port: 8787 });
console.log(`http://127.0.0.1:${server.port}`);

// Diğer ortamlar (Workers, Bun, Deno): app.fetch doğrudan kullanılabilir

createRelbyteApp() ile listen() ayrı tutulur — aynı Hono uygulaması birden fazla runtime'da çalışabilir.

Kimlik doğrulama

const app = createRelbyteApp({
  db,
  authorize: async ({ request }) => {
    const token = request.headers.get('authorization');
    if (token !== `Bearer ${process.env.RELBYTE_TOKEN}`) return null;
    return { read: true, write: true, schema: false, stats: false };
  },
});

Yetkiler: read, write, schema, stats, admin.

Salt okunur mod

createRelbyteApp({ db, mode: 'read-only' });

POST /v1/transaction yazma izni olmadan reddedilir.

Sorgu protokolü

POST /v1/query
Content-Type: application/json

{
  "table": "users",
  "select": ["id", "name"],
  "where": [["age", ">=", 18]],
  "orderBy": [["createdAt", "desc"]],
  "limit": 100,
  "offset": 0
}

Yanıt:

{
  "data": [{ "id": 1, "name": "Alice" }],
  "meta": { "count": 1 }
}

NDJSON akışı

POST /v1/query?stream=true
Accept: application/x-ndjson

Satır satır JSON döner; bellek kullanımı sonuç boyutuyla değil batch boyutuyla sınırlıdır. İstek iptal edildiğinde (AbortSignal) sorgu durur ve snapshot serbest bırakılır.

İşlem protokolü

POST /v1/transaction

{
  "operations": [
    { "op": "insert", "table": "users", "value": { "id": 42, "name": "Ahmet" } },
    { "op": "update", "table": "users", "value": { "id": 42, "name": "Ahmet Y." } },
    { "op": "delete", "table": "users", "primaryKey": 42 }
  ]
}

Tüm işlemler tek db.transaction() içinde atomik olarak çalışır.

Wire format (tipler)

| Relbyte tipi | HTTP JSON | |----------------|-------------------------------------| | timestamp_ms | ISO-8601 UTC (2026-09-12T11:00:00.000Z) | | date | YYYY-MM-DD | | int64 | ondalık string ("9223372036854775807") | | bytes | { "$bytes": "base64..." } | | json | normal JSON |

Limitler

createRelbyteApp({
  db,
  limits: {
    maxBodyBytes: 1_048_576,
    maxRows: 10_000,
    maxQueryMs: 30_000,
    maxTransactionOperations: 1_000,
    maxConcurrentQueries: 64,
    maxLimit: 10_000,
    maxOffset: 1_000_000,
  },
});

Hata formatı

{
  "error": {
    "code": "TABLE_NOT_FOUND",
    "message": "Table users2 does not exist"
  }
}

Tam protokol spesifikasyonu: docs/http-protocol-v1.md.

Kapatma

await app.shutdown(); // aktif istekleri reddeder, db.close() çağırır