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

@silvermine/quarry

v0.3.2

Published

Node.js binding for Quarry, a serverless hybrid search engine that keeps its index in object storage

Readme

quarry-node

A Node.js binding for Quarry: the npm package @silvermine/quarry. It gives a JavaScript or TypeScript host the producer API and the engine's entry points. The package also contains lambda/bootstrap, the Lambda hosts built for Linux x64, so one package supplies a deployment's Node.js functions and its build and task functions.

cd crates/quarry-node
npm run build -- --linux
npm test
npm pack

npm run build builds the binding for this machine. With --linux, it also builds the binding and lambda/bootstrap for Linux x64 with cargo zigbuild. Install zig and cargo-zigbuild first, and add the Rust target x86_64-unknown-linux-gnu. The package contains one .node file for each platform, and index.js loads the file for the platform it runs on: macOS on arm64, or Linux on x64 with glibc 2.28 or later. Git ignores every file that the build makes, and npm pack stops when one of them is not there or is older than the source.

Use

npm install @silvermine/quarry
const { open } = require('@silvermine/quarry');

const quarry = await open({ durableBucket: 'my-durable', servingBucket: 'my-serving--use1-az4--x-s3' });

const transaction = await quarry.beginReplace('articles', { schema });

await transaction.upsert({
   id: 'article-48112',
   fields: { title: { exact: [ 'storm', 'closes', 'harbor', 'bridge' ] } },
   stored: { title: 'Storm Closes Harbor Bridge' },
});

const commitId = await transaction.commit();

await quarry.build('articles');
await quarry.status('articles', commitId); // { state: 'applied', epoch: 1 }

const response = await quarry.search({ index: 'articles', tokens: { exact: [ 'harbor' ] } });

index.d.ts declares every function, option, and error code.

  • One Quarry for each process. open makes one engine, with its memory cache, and one producer. Call it one time and keep the result. A Quarry reads the list of epochs again only after the index's refreshSeconds, as each query worker does.
  • Stores. durableBucket and servingBucket select the S3 adapters, with the credentials and the region of the environment. dataDirectory selects two local folders, as the quarry command does. The binding has no allow list, so the host selects the buckets.
  • A process that only searches. readOnlyServing makes the binding request read-only sessions on the serving bucket. Then build and gc reject.
  • JSON. Documents, schemas, requests, responses, and records are the JSON that the Quarry documents specify. The binding sends them to Rust as text and does not rename a field.
  • Errors. Each failure rejects with an Error. Its message is Quarry's text, and its code is the kind of failure: InvalidRequest for a document or a request that Quarry refuses, NotFound, CorruptData, Other for storage and all other failures, and InvalidArg for an argument that the binding refuses.
  • Transactions. An invalid document rejects, and the transaction stays open without it. Await each call before the next call. After commit, the transaction is closed.
  • Shared transactions. share, join, finish, and commitShared let several processes write one transaction, such as a replace that loads a whole index (see shared transactions).
  • Build and garbage collection. build and gc run in the process, on a thread of their own, in the single rebuild mode. A function host with a time limit uses the build host in lambda/bootstrap for rebuilds and merges.

On AWS Lambda

Quarry on AWS Lambda tells how a function sets up the memory cache, the disk cache, and the local replica, how it keeps copies running after each response, and which indexes it copies at start.