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 🙏

© 2024 – Pkg Stats / Ryan Hefner

libsql-stateless

v2.9.1

Published

thin libSQL stateless http driver for TypeScript and JavaScript

Downloads

18,360,273

Readme

libsql-stateless

Thin libSQL stateless HTTP driver for TypeScript and JavaScript for the edge 🚀

  • Supported runtime environments: Web API (browser, serverless), Bun, Node.js (>=18)
  • Extremely thin: Has no dependency, only has a few functions that implement the Hrana v3 HTTP protocol from scratch, and has no classes (tend to duplicate memory and/or perform long memory traversals).
  • Does no extra computation.
  • Has no premature optimizations.
  • Is extremely light: 1.15kB (unpacked)* / 548B (gzipped)
  • ✅ Unlike @libsql/client/web, every function performs complete execution in exactly 1 roundtrip.
  • Is built for: Quick stateless query execution. (Mainly for serverless and edge functions.)
  • Supports everything in @libsql/client/web
  • ⚠️ Interactive transactions are not supported because this lib is stateless but transactions are supported.
  • ⚠️ The API provided by libsql-stateless is raw and explicit for reducing (computational and memory) overheads.

* The actual js that is included with your project. (Excluding the type definitions and 2 copies of the main js for esm and cjs. (because you're gonna use one of them))

For easier DX, consider using libsql-stateless-easy instead: it, however, comes with the cost of non-zero-dependency and (computational and memory) overheads potentially unneeded by you. But is still very very very slim compared to @libsql/client.

Why not just use @libsql/client/web?

  1. Not everyone needs stateful DB connection or the overheads that come with it.
  2. To provide a simpler API, @libsql/client/web does a lot of, I'd argue unnecessary, computation under the hood.
    Many people would rather use a more complex API than have worse performance.

Installation

$ npm i libsql-stateless #pnpm, yarn, etc.
# or
$ bun add libsql-stateless

Goto WIKI for Specifications and Examples

API Level

NOTE: <unix_epoch_miliseconds>-HRANA_3_SPEC.md is the current API level.
Downloaded from: https://github.com/tursodatabase/libsql/blob/main/docs/HRANA_3_SPEC.md at <unix_epoch_miliseconds>.
Servers using older API levels may not be compatible. In that case downgrade to an earlier of this package.