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

@facturion/pointer-patterns

v0.1.1

Published

JSON Pointer patterns: a strict superset of JSON Pointer (RFC 6901) with wildcards, an anchor-bound index and entry filters, matched against a document to concrete pointers, including places that don't exist yet.

Readme

@facturion/pointer-patterns

JSON Pointer patterns: a strict superset of JSON Pointer (RFC 6901) that names a set of places in a JSON document, including places that don't exist yet. Matching a pattern against a document always yields concrete JSON Pointers.

Built to map validation rules to the fields they concern: a table of patterns, independent of any one document, resolved against a document and an anchor, the pointer of where a rule fired. The full grammar and semantics are in SPEC.md; vectors.json holds language-neutral test vectors written from it.

npm install @facturion/pointer-patterns

Syntax at a glance

| Pattern | Means | |---|---| | /seller/vat_id | A JSON Pointer: exactly that place, whether it exists or not. | | /lines/~*/net_amount | Every line's net amount. | | /lines/~./period | The period of the line the anchor is in (every line's, if the anchor is in none). | | /item/attributes/~?name=cva | The attributes named cva; if there are none, the list as the place to add one. | | /lines/~?vat~1category_code=S/net_amount | The net amounts of the lines whose vat.category_code is S. | | /notes/~?subject_code!=AAK | The notes with another subject code. | | /seller/identifiers/~?!scheme_id/scheme_id | The missing scheme of exactly the identifiers that have none. | | 0/scheme_id | Relative to the anchor (Relative JSON Pointer). |

The extension tokens all begin with an escape RFC 6901 forbids (~ before anything but 0 or 1), so they can never collide with a real key.

Usage

import { match, parsePattern, pointer } from "@facturion/pointer-patterns";

const doc = { lines: [{ period: { start_date: "2026-03-01" } }, {}] };

match("/lines/~./period/end_date", doc, pointer("/lines/1/net_amount"));
// → [{ kind: "place", pointer: "/lines/1/period/end_date", exists: false }]

match("/lines/~?id=7", doc);
// → [{ kind: "add-entry", list: "/lines", member: ["id"], value: "7" }]

// Parse once (a malformed pattern throws PatternSyntaxError with its offset),
// match many times.
const p = parsePattern("/lines/~*/period");
  • match(pattern, document, anchor?) → results in document order: a place (a pointer, and whether it resolves) or an add-entry (a filter matched no entry of the list).
  • parsePattern(source) → the parsed Pattern, or a PatternSyntaxError.
  • pointer(string) → a checked JsonPointer. Anchors and results are JsonPointer, a branded string, so an unchecked string can't be passed where a pointer is expected.
  • get(document, pointer), isPrefix(a, b), tokens(pointer), fromTokens(tokens): RFC 6901 helpers.