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

@bigmoves/tantivy-js

v0.1.5

Published

Full-text search powered by tantivy, compiled to native Node.js addon

Downloads

184

Readme

tantivy-js

Full-text search powered by tantivy as a native Node.js addon. Multi-threaded, fast, with support for in-memory and persistent indexes.

Installation

npm install @bigmoves/tantivy-js

Usage

import { SchemaBuilder, Index } from '@bigmoves/tantivy-js';

// Define schema
const schema = new SchemaBuilder()
  .addTextField('title', { stored: true, indexed: true })
  .addTextField('body', { stored: true, indexed: true })
  .addI64Field('year', { stored: true })
  .build();

// Create in-memory index
const index = Index.create(schema);

// Or open/create a persistent index
// const index = Index.open('./my-index', schema);

// Add documents
const writer = index.writer();
writer.addDocument({ title: 'Rust Programming', body: 'Learn Rust basics', year: 2024 });
writer.addDocument({ title: 'JavaScript Guide', body: 'Modern JS patterns', year: 2023 });
writer.commit();

// Search
const searcher = index.searcher();
const results = searcher.search('rust', ['title', 'body'], { limit: 10 });
console.log(results);
// [{ title: 'Rust Programming', body: 'Learn Rust basics', year: 2024 }]

Query Syntax

tantivy-js supports the standard tantivy query syntax:

  • Terms: rust - matches documents containing "rust"
  • Phrases: "hello world" - matches exact phrase
  • Boolean: rust AND programming, rust OR javascript, rust NOT beginner
  • Field-specific: title:rust - search only in title field

API

SchemaBuilder

  • addTextField(name, options?) - Add a text field
  • addI64Field(name, options?) - Add an integer field
  • addF64Field(name, options?) - Add a float field
  • addBytesField(name, options?) - Add a bytes field
  • build() - Build the schema

Field options:

  • stored: boolean - Store value for retrieval (default: false)
  • indexed: boolean - Index for searching (default: true)
  • fast: boolean - Enable fast field (numeric only, default: false)

Index

  • Index.create(schema) - Create a new in-memory index
  • Index.open(path, schema) - Open or create a persistent index at path
  • writer(heapSize?) - Get an IndexWriter
  • searcher() - Get a Searcher

IndexWriter

  • addDocument(doc) - Add a document (plain JS object)
  • deleteByTerm(field, term) - Delete documents matching term
  • commit() - Commit pending changes

Searcher

  • search(query, fields, options?) - Search the index

Platforms

Prebuilt binaries are available for:

  • macOS (x64, arm64)
  • Linux (x64, arm64)

Building from Source

Requirements:

  • Rust toolchain
  • Node.js 18+
npm install
npm run build

License

MIT