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

@filter-enginez/svelte-signals

v0.0.6

Published

Svelte stores for faceted search and filtering: reactive results, counts and filter state from the Filter EngineZ engine.

Downloads

257

Readme

@filter-enginez/svelte-signals

Svelte store bindings over @filter-enginez/reactive-signals. Browser-only.

The engine's reactive state is @preact/signals-core signals; Svelte consumes anything implementing its Readable contract. This package is the adapter between the two, plus the context plumbing to get an engine to a component without threading it through props.

Install

pnpm add @filter-enginez/svelte-signals

Peer dependencies: svelte@^5.0.0 — supplied by your app.

Usage

Provide the engine once, near the root:

<script lang="ts">
  import type { Snippet } from 'svelte';
  import type { SignalsEngine } from '@filter-enginez/reactive-signals';
  import { setFilterEngine } from '@filter-enginez/svelte-signals';
  import type { Wine } from './wine';

  let { children, engine }: { children: Snippet; engine: SignalsEngine<Wine> } = $props();

  setFilterEngine(engine);
</script>

{@render children()}

Then read it anywhere below:

<script lang="ts">
  import { createEngineStores, getFilterEngine } from '@filter-enginez/svelte-signals';
  import type { Wine } from './wine';

  const { results, resultCount } = createEngineStores(getFilterEngine<Wine>());
</script>

<p>{$resultCount} matches</p>
<ul>
  {#each $results as wine (wine.id)}
    <li>{wine.title}</li>
  {/each}
</ul>

Svelte 5 reads a Readable store with the $ prefix in markup and in runes alike, so these stores work unchanged inside $derived (const empty = $derived($resultCount === 0);).

API

| Export | What it is | | ------------------------------------- | ------------------------------------------------------------------------------ | | setFilterEngine / getFilterEngine | Svelte context put/get for the engine — call set during component init | | createEngineStores | Engine signals as Svelte Readable stores (EngineStores, LastChange) | | toStore | The primitive underneath: one ReadonlySignalLike to one Svelte store | | busyStore(tracker) | From an EngineBusyTracker: a store that is true while a query is in flight |

getFilterEngine() with no engine set above the component throws FilterEngineConfigError with code BINDING_ENGINE_NOT_PROVIDED.

Hold the engine in plain or $state.raw state, never deep $state: Svelte's deep proxy wraps the engine object and breaks the @preact/signals-core signals inside it, so filtering stops without an error.

toStore is exported rather than kept internal because a consumer composing their own derived state needs the same bridge, and reimplementing it means getting the subscribe/unsubscribe lifetime right a second time.

Documentation

Consumer guides live in the engine repository under docs/guides/:

  • extending_rules.md — writing a custom FilterRule that survives serialization
  • json_config.md — declaring filters as data, and why the format is safe to accept from a tenant
  • acceleration_tuning.md — what the five acceleration toggles are worth, measured
  • worker_offload.md — running the engine in a Web Worker

Project home, with six live demos: https://filterenginez.com. Documentation site: https://docs.filterenginez.com.

Apache-2.0. See LICENSE.md and NOTICE.md, both included in this package.