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

turboquant-search

v0.1.1

Published

Vector search for JSON datasets. Build quantized indexes and search with WASM SIMD.

Readme

turboquant-search

Vector search for JSON datasets. Build quantized indexes and search with WASM SIMD.

Takes any JSON array, embeds text fields into vectors, compresses them with 3-bit quantization, and runs similarity search entirely via WebAssembly SIMD, in the browser or Node.js.

Install

npm install turboquant-search

Quick Start

import { TurboSearch } from 'turboquant-search';

// Build from any JSON array
const ts = await TurboSearch.from(products, {
  fields: ['name', 'description', 'tags'],
});

// Text search
const results = await ts.search('wireless audio bluetooth', { topK: 5 });
// => [{ index: 0, score: 0.94, data: { name: 'Wireless Headphones', ... } }]

// Find similar items
const similar = ts.similar(0, { topK: 5 });

// Save for later
await ts.save('./products.index.json');

// Load a pre-built index
const loaded = await TurboSearch.load('./products.index.json');

// Clean up
ts.destroy();

CLI

# Build an index
npx tqs build --input products.json --fields "name,description,tags" --output search.json

# Inspect an index
npx tqs info search.json

API

TurboSearch.from(data, options)

Build a search index from a JSON array.

| Option | Type | Default | Description | |---|---|---|---| | fields | string[] | required | Fields to embed | | dim | number | 384 | Embedding dimensions | | bits | number | 3 | Quantization bits | | seed | number | 42 | Random seed | | embedder | Embedder | keyword | Custom embedder |

TurboSearch.load(pathOrUrl)

Load a pre-built index from a file or URL.

Instance Methods

ts.search(query, { topK })     // text search
ts.similar(index, { topK })    // find similar items
ts.vectorSearch(vec, { topK }) // search by embedding
ts.save(path)                  // save index to disk
ts.size                        // number of indexed items
ts.destroy()                   // clean up WASM

Custom Embedder

// Works with any embedding source: transformers.js, OpenAI, Gemini, Cohere, etc.
import { pipeline } from '@xenova/transformers';

const extractor = await pipeline('feature-extraction', 'Xenova/all-MiniLM-L6-v2');

const ts = await TurboSearch.from(data, {
  fields: ['text'],
  embedder: {
    async embed(text, dim) {
      const output = await extractor(text, { pooling: 'mean', normalize: true });
      return new Float32Array(output.data);
    },
  },
});

Scalability

| Items | Index Size | Search Time | |---|---|---| | 100 | ~14 KB | <1ms | | 10,000 | ~1.4 MB | ~5ms | | 50,000 | ~7 MB | ~15ms | | 100,000 | ~14 MB | ~30ms |

How It Works

  1. Text extraction - concatenates specified JSON fields per item
  2. Embedding - TF-IDF keyword hashing into 384-dim vectors (or your custom embedder)
  3. Quantization - 3-bit TurboQuant compression (1,536 bytes to ~144 bytes per vector)
  4. Search - WASM SIMD dot products, returns top-K results

License

MIT