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

bare-usearch

v0.1.0

Published

USearch vector similarity search bindings for Bare

Readme

bare-usearch

Native USearch bindings for Bare.

Fast approximate nearest neighbor search for high-dimensional vectors.

Requirements

  • CMake 3.25+
  • C/C++ compiler (clang, gcc, or MSVC)
  • Node.js (for npm/cmake-bare)
  • Bare runtime

Building

Clone with submodules:

git clone --recursive https://github.com/CameronTofer/bare-usearch
cd bare-usearch

Or if already cloned:

git submodule update --init --recursive

Install dependencies and build:

npm install
npm run build

Usage

const { Index } = require('bare-usearch')

// Create index with 128-dimensional vectors
const index = new Index({
  dimensions: 128,
  metric: 'cos'  // cosine similarity
})

// Add vectors (key, vector)
index.add(1, new Float32Array([0.1, 0.2, ...]))
index.add(2, new Float32Array([0.3, 0.4, ...]))

// Search for k nearest neighbors
const results = index.search(queryVector, 10)
console.log(results.keys)       // [2, 1, ...]
console.log(results.distances)  // Float32Array

// Persistence
index.save('index.usearch')
index.load('index.usearch')

// Cleanup
index.free()

See examples/ for more:

  • basic.js - Basic usage with add/search/remove
  • persistence.js - Saving and loading indexes
  • topics.js - Topic extraction using vector similarity

Run examples with:

bare examples/basic.js

Testing

npm test            # bare
npm run test:node   # node

API Reference

Index

new Index(options?)

| Option | Type | Default | Description | |--------|------|---------|-------------| | dimensions | number | required | Vector dimensionality | | metric | string | 'cos' | Distance metric | | quantization | string | 'f32' | Scalar quantization | | connectivity | number | auto | Graph connectivity (M) | | multi | boolean | false | Allow multiple vectors per key |

Metrics: 'cos', 'ip' (inner product), 'l2' (L2 squared), 'hamming', 'jaccard'

Quantization: 'f32', 'f16', 'i8'

Properties:

  • size - Number of vectors in index
  • dimensions - Vector dimensionality
  • capacity - Current capacity

Methods:

  • add(key, vector) - Add a vector with numeric key
  • search(query, k) - Find k nearest neighbors, returns { keys, distances, count }
  • remove(key) - Remove vector by key
  • contains(key) - Check if key exists
  • get(key) - Retrieve vector by key (returns Float32Array or null)
  • reserve(capacity) - Pre-allocate space for vectors
  • save(path) - Save index to file
  • load(path) - Load index from file
  • view(path) - Memory-map index from file (read-only)
  • clear() - Remove all vectors
  • free() - Release resources

Platform Support

| Platform | Architecture | |----------|--------------| | macOS | arm64, x64 | | Linux | x64, arm64 | | Windows | x64, arm64 | | Android | arm64, arm, x64, ia32 | | iOS | arm64, x64 (simulator) |

License

MIT