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

veqlite

v0.2.1

Published

A ready-to-use vector database/RAG TypeScript library implemented with SQLite and @huggingface/transformers.

Downloads

46

Readme

veqlite

A simple vector database library written in TypeScript using SQLite with the sqlite-vec extension.

Features

  • Store text chunks with metadata and embeddings
  • High-level integration with @huggingface/transformers
  • Fast similarity search using cosine distance
  • Support for custom metadata types
  • Bulk insertion for improved performance
  • In-memory or persistent database options
  • Multiple runtime support (Bun, Node.js)

For more details about the project structure and API, see overview.md and api.md.

Usage Example

import { VeqliteDB, HFLocalEmbeddingModel } from "veqlite";
import { BunSQLiteAdapter } from "veqlite/bun";
//import { NodeSQLiteAdapter } from "veqlite/node"
//import { BetterSqlite3Adapter } from "veqlite/better-sqlite3"
// Simple example of using veqlite
async function main() {
  // Initialize the embedding model
  const embeddingModel = await HFLocalEmbeddingModel.init(
    "sirasagi62/granite-embedding-107m-multilingual-ONNX",
    384,
    "q8"
  );

  // On macOS with Bun (requires custom SQLite dylib)
  // const bunsqlite = new BunSQLiteAdapter(":memory:", "/opt/homebrew/lib/libsqlite3.dylib");
  // On other platforms with Bun
  // const bunsqlite = new BunSQLiteAdapter(":memory:");
  // With PGLite (PostgreSQL with pgvector)
  const dbAdapter = new PGLiteAdapter(":memory:");
  // Create RAG database instance
  const rag = await VeqliteDB.init(embeddingModel, bunsqlite, {
    embeddingDim: 384
  });

  // Add some documents
  await rag.insertChunk({
    content: "TypeScript is a typed superset of JavaScript",
    filepath: "typescript-intro"
  });
  await rag.insertChunk({
    content: "RAG stands for Retrieval Augmented Generation",
    filepath: "rag-intro"
  });
  await rag.insertChunk({
    content: "Veqlite is a simple RAG implementation in TypeScript",
    filepath: "veqlite-intro"
  });

  const query = "What is RAG?";
  console.log(`Query: ${query}`);
  // Query the system
  const results = await rag.searchSimilar(query);

  console.log("🎉 Search results:");
  results.forEach((r, i) => {
    console.log(`#${i + 1}: ${r.content}`);
    console.log(`   Similarity score: ${r.distance.toFixed(4)}`);
    console.log(`   File: ${r.filepath}\n`);
  });

  // Close the database
  rag.close();
}

main().catch(console.error);

Output

Query: "What is RAG?"
Searching for similar content...

🎉 Search results:
#1: RAG stands for Retrieval Augmented Generation
   Similarity score: 0.2203
   File: rag-intro

#2: Veqlite is a simple RAG implementation in TypeScript
   Similarity score: 0.3020
   File: veqlite-intro

#3: TypeScript is a typed superset of JavaScript
   Similarity score: 0.4220
   File: typescript-intro

Run the example

bun run examples/simple.ts

Adapter Selection Guide

VeqliteDB supports multiple SQLite adapter implementations depending on your runtime environment:

| Runtime | Adapter | Installation | Notes | |--------|--------|-------------|-------| | Bun | BunSQLiteAdapter | Built-in | On macOS, specify path to libsqlite3.dylib | | Node.js | NodeSQLiteAdapter | Built-in | Requires Node v24+ | | Node.js (high performance) | BetterSqlite3Adapter | npm install better-sqlite3 | Native bindings, faster bulk operations |

Example Adapter Usage

BunSQLiteAdapter (Bun runtime)

import { BunSQLiteAdapter } from "veqlite/bun";

// On macOS
const adapter = new BunSQLiteAdapter(":memory:", "/opt/homebrew/lib/libsqlite3.dylib");
// On other platforms
const adapter = new BunSQLiteAdapter(":memory:");

NodeSQLiteAdapter (Node.js runtime)

import { NodeSQLiteAdapter } from "veqlite/node";

const adapter = new NodeSQLiteAdapter("chunks.db");

BetterSqlite3Adapter (Node.js runtime)

import { BetterSqlite3Adapter } from "veqlite/better-sqlite3";

const adapter = new BetterSqlite3Adapter("chunks.db");

Installation

# For Bun or Node.js with built-in SQLite
npm install veqlite

# For Node.js with better-sqlite3 (recommended for high performance)
npm install veqlite better-sqlite3

Development

We use bun to develop the library.

# Install dependencies
bun install

# Run tests
bun test

# Build the library
bun run build

This project was created using bun init. Bun is a fast all-in-one JavaScript runtime.