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 🙏

© 2025 – Pkg Stats / Ryan Hefner

unified-query

v0.1.0

Published

Composable search input with autocompletion and a rich query-language parser for the Unified Data System

Readme

unified-query

⚠️ Work in progress
unified-query is still under active development and forms part of the Unified Data System (not yet open‑sourced). Breaking changes are likely until that foundation is public.

Search input powered by CodeMirror 6 and a custom query language for the Unified Data System.


Install

npm i unified-search

Quick start

const theme = createTheme({
    icons,
    fontFamily: 'Roboto, sans-serif',
    keyword: { color: '#268bd2', fontWeight: '600' },
    entityName: { color: 'black' }
})

const search = new Search({ 
    element: e, 
    query: '@kind note @yesterday',
    onChange: (q) => handleSearch(q), 
    theme 
})

Query language spec

Basics

  • The head of the string searches by name, e.g. Search: apple@name apple.

Keywords

| Keyword | Usage | Notes | | ---------------------------- | ----------------------------------------------------------- | ----- | | @id <id…> | Match specific entity IDs (UUID v4). | | | @name <text> | Exact‑match name. Alias of @content. | | | @content <text> | Reads until the next @. Escape @ with \@. | | | @kind <kind…> | Filter by kinds (note, log, space, …). | | | @in <id…> | Contained in parent IDs. Add * for deep search (id2*). | | | @todo | Shortcut for @completed false. | | | @done <date…>\|<bool> | Completed on date(s) or flag. Narrows to completable kinds. | | | @draft [bool] | Draft flag (default true). | | | @archived [date…]\|[bool] | Archive date or flag. | | | @deleted [date…]\|[bool] | Deletion date or flag (default true). | | | @created <date…> | Creation date(s). | | | @updated <date…> | Update date(s). | | | @changed <date…> | Any of created/updated/deleted/archived on date(s). | | | @time <time…> | Explicit time field. | | | @sort <field[:asc\|desc]…> | Default: name asc. | | | @limit [n] | Default 100. | | | Shorthands | @note, @log, … ⇒ @kind note log. | |

Intervals

Use < or > before a value:

  • <2024/01 — before January 2024 (exclusive)
  • >12:00   — after 12:00 (inclusive)

Only one < and one > per field.

Date formats

  • YYYY          → 2024
  • YYYY/MM      → 2024/01
  • YYYY/MM/DD → 2024/01/01

These map to half‑open ranges: 2024>2024 <2025.

Time formats

  • HH[:mm] (24h) — 12, 12:01
  • h[:mm][am\|pm] (12h) — 12pm, 12:00am

Example: 12pm>12:00 <13:00.

Date + time

Combine freely, e.g.:

@created 2024 >12pm   # entities created in the afternoon of 2024

Date‑time literal

Use long form:

  • YYYY/MM/DD-HH:mm>2024/01/01-12:00

Timezone

Currently assumed user‑local. Cross‑TZ querying is TBD.

Utility tokens

Valid after time fields (@created, @updated, @deleted, @archived, @changed, @completed):

  • today, yesterday
  • lastNdays, lastNweeks
  • Weekdays: monsun / MondaySunday
  • Months: jandec / JanuaryDecember