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 🙏

© 2024 – Pkg Stats / Ryan Hefner

@stereobooster/facets

v0.1.1

Published

Client-side (though you can run it on the server) faceted search engine

Downloads

89

Readme

Facets

Facets is a client-side (though you can run it on the server) faceted search engine.

Facet - any of the definable aspects that make up a subject (as of contemplation) or an object (as of consideration)

Facets main purpose is to do the faceting aspect of the search. Text search is outsourced to other libraries, for example, you can use:

The main secret ingredient is TypedFastBitSet.js - a fast set data structure. Using it and standard Map allows us to build an inverted-index data structure. From there, it's a pretty straightforward implementation.

Demo

It is easier to show than explain. See online demo here.

Is it ready for production?

The demo works, as you can see, but beyond that, there was no exhaustive testing. There are still rough edges. API can change.

TODO

  • default values for facet by type
    • number
      • sort by value asc
      • showZeroes=false
  • initialization
  • memoization
  • ​maxValuesPerFacet
  • facets: "price"
  • numeric filter
    • support > (not just >=), < (not just <=)
    • support multiple ranges e.g [{ from, to }, { eq }, { neq }]
  • more tests
  • errors and warnings, for example
    • warn if people try to use text search without providing text index
  • benchmarks
    • performance seems to be good (except numeric range filter), but in order to be sure we need to do benchmark
  • benchmark memory
    • https://www.valentinog.com/blog/node-usage/
    • I'm curious if using TrieMap would allow to save memory