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

@shapeshift-labs/frontier-query

v0.1.2

Published

Shared query, selector, and table-shape primitives for Frontier packages.

Readme

Frontier Query

Shared query, selector, and table-shape primitives for Frontier packages.

This package defines the dependency-free vocabulary that Frontier mutation, state-cache, and future query runtimes can share without pulling in app state, patch codecs, or CRDT behavior.

Related Packages

Package source repositories:

Install

npm install @shapeshift-labs/frontier-query

Usage

import {
  hashQueryKey,
  matchesQueryConditions,
  normalizeQueryPath
} from '@shapeshift-labs/frontier-query';

const key = hashQueryKey(['todos', { status: 'open', page: 1 }]);
const path = normalizeQueryPath('/todos/0/title');
const matches = matchesQueryConditions(
  { id: 't1', done: false, priority: 4 },
  [{ field: 'priority', gte: 3 }, { field: 'done', eq: false }]
);

API

Query Keys

  • hashQueryKey(key) creates a deterministic JSON query-key string with stable object-key ordering.
  • partialMatchQueryKey(candidate, partial) supports prefix/object-subset invalidation checks.

Paths And Schemas

  • normalizeQueryPath(path, label?) accepts JSON pointer strings, dot paths, or path arrays.
  • normalizeQuerySchema(schema, label?) normalizes trusted table/entity schema hints.

Conditions

  • readQueryCondition(fieldOrCondition, op?, value?) creates or clones condition objects.
  • cloneQueryCondition(condition) clones nested condition trees and normalizes condition paths.
  • collectQueryConditionFields(conditions, out) records every field path read by a condition tree.
  • matchesQueryConditions(value, conditions, meta?) evaluates selector/query predicates.
  • readQueryConditionValue(value, field, meta?) reads a row field or special $key/$index/$mapKey meta field.
  • readQueryConditionEqualityHint(conditions, field) extracts equality/in hints for indexes.
  • normalizeQueryOperator(condition) resolves operator aliases such as ==, gte, and <=.
  • readQueryConditionExpected(condition, op) reads the canonical expected value for a resolved operator.

Entity Identity

  • identifyQueryEntity(input, options?, path?) implements __typename plus id/_id identity with custom overrides.

Special condition fields:

  • $key is the current object-map key or resolved row key.
  • $index is the current array row index.
  • $mapKey is the current object-map key when it should be kept distinct from keyBy().

Subpath Imports

This package currently exposes the root entry point only:

import { hashQueryKey } from '@shapeshift-labs/frontier-query';

Package Scope

Use this package when multiple Frontier layers must agree on selector/query semantics. Keep runtimes elsewhere:

  • normalized query-result storage belongs in state-cache,
  • write planning belongs in @shapeshift-labs/frontier-mutation,
  • patch routing and owned app state belong in Frontier state packages,
  • compact diff/apply stays in @shapeshift-labs/frontier.

TypeScript

The package ships ESM JavaScript plus .d.ts declarations for the root export. The package-local TypeScript source lives in src/ and compiles directly to dist/.

Validation

npm test
npm run fuzz
npm run bench
npm run pack:dry

Benchmarks

Run the package-local benchmark:

npm run bench

Latest local package benchmark on Node v26.1.0, darwin arm64, 9 rounds:

| Fixture | Median | p95 | | --- | ---: | ---: | | Stable query key hash | 0.54 us | 0.58 us | | Partial query key match | 0.04 us | 0.09 us | | Condition match over row | 0.08 us | 0.24 us | | Schema normalization | 0.45 us | 0.53 us | | Entity identity read | 0.01 us | 0.04 us |

These are Frontier-only package measurements, not competitor comparisons.

License

MIT. See LICENSE.