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

libsqlproxy

v0.1.0

Published

Runtime-agnostic Hrana v2 HTTP server for SQLite. Expose any SQLite database (Cloudflare Durable Objects, libsql, better-sqlite3) via the libSQL remote protocol.

Readme

libsqlproxy

Runtime-agnostic Hrana v2 HTTP server for SQLite. Expose any SQLite database via the libSQL remote protocol.

Expose your Cloudflare Durable Object data to data explorers like Drizzle Studio and TablePlus so you can browse, edit, and manage your DO storage from a GUI. Also works with Node.js libsql, better-sqlite3, or any custom SQL driver.

Connect with @libsql/client, Drizzle Studio, TablePlus, or any tool that speaks the libSQL remote protocol.

Install

npm install libsqlproxy

Cloudflare Workers + Durable Objects

Expose a Durable Object's embedded SQLite over the libSQL protocol.

wrangler.json:

{
  "name": "my-worker",
  "main": "src/index.ts",
  "compatibility_date": "2026-03-20",
  "routes": [
    { "pattern": "libsql.example.com", "custom_domain": true },
    { "pattern": "example.com", "custom_domain": true }
  ],
  "durable_objects": {
    "bindings": [
      { "name": "MY_DO", "class_name": "MyDO" }
    ]
  }
}

Durable Object (src/my-do.ts):

import { DurableObject } from 'cloudflare:workers'
import { createLibsqlHandler, durableObjectExecutor } from 'libsqlproxy'

export class MyDO extends DurableObject {
  hranaHandler = createLibsqlHandler(durableObjectExecutor(this.ctx.storage))
}

Worker (src/index.ts):

import { createLibsqlProxy } from 'libsqlproxy'

export default {
  async fetch(request: Request, env: Env) {
    const url = new URL(request.url)

    // Only handle libsql proxy on the dedicated hostname
    if (url.hostname.startsWith('libsql.')) {
      const proxy = createLibsqlProxy({
        secret: env.LIBSQL_SECRET,
        getStub: ({ namespace, env }) => {
          const id = env.MY_DO.idFromString(namespace)
          return env.MY_DO.get(id)
        },
      })
      return proxy(request, env)
    }

    // Normal Worker logic
    return new Response('Hello')
  },
}

Connect from anywhere:

import { createClient } from '@libsql/client'

const client = createClient({
  url: 'https://libsql.example.com',
  authToken: 'my-durable-object-id:my-shared-secret',
  //          ^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^
  //          namespace (DO ID)       shared secret
})

await client.execute('SELECT * FROM users')

The authToken format is namespace:secret where:

  • namespace identifies which Durable Object to route to
  • secret is validated against the shared secret configured in the Worker

This works with TablePlus, Drizzle Studio, and any tool that accepts a libSQL URL + auth token.

Node.js

import http from 'node:http'
import Database from 'libsql'
import {
  createLibsqlHandler,
  createLibsqlNodeHandler,
  libsqlExecutor,
} from 'libsqlproxy'

const database = new Database('my.db')
const handler = createLibsqlHandler(libsqlExecutor(database))
const nodeHandler = createLibsqlNodeHandler(handler, {
  auth: { bearer: 'my-secret-token' },
})

http.createServer(nodeHandler).listen(8080)
// Connect with: libsql://localhost:8080, authToken: 'my-secret-token'

Custom SQL Driver

Implement the LibsqlExecutor interface for any database:

import { createLibsqlHandler } from 'libsqlproxy'

const handler = createLibsqlHandler({
  executeSql(sql, params) {
    // Return { cols, rows, affected_row_count, last_insert_rowid }
    return myDriver.query(sql, params)
  },
  execRaw(sql) {
    // Execute raw SQL (multiple statements, no results)
    myDriver.exec(sql)
  },
})

// handler is (Request) => Promise<Response>

Both sync and async executors are supported.

API

| Export | Description | |---|---| | createLibsqlHandler(executor) | Core handler. Takes a LibsqlExecutor, returns (Request) => Promise<Response> | | createLibsqlNodeHandler(handler, opts?) | Node.js adapter. Wraps the fetch handler for http.createServer() | | createLibsqlProxy(opts) | Cloudflare Worker proxy. Parses namespace:secret from Bearer token, routes to DO | | libsqlExecutor(database) | Adapter for libsql / better-sqlite3 | | durableObjectExecutor(storage) | Adapter for CF Durable Object ctx.storage |

Protocol Support

Implements the Hrana v2 HTTP protocol:

  • execute - single statement with positional/named params
  • batch - multi-step conditional execution (ok/not/and/or)
  • sequence - raw SQL semicolon-separated execution
  • describe - column/parameter info without executing
  • store_sql / close_sql - stream-scoped SQL caching
  • close - stream teardown
  • Baton-based stateful streams for interactive transactions

License

MIT