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

legal-docs-types

v1.0.0

Published

TypeScript types for the Case Law Explorer API's data contract. No client, no requests, no credentials — safe to import from browser code.

Readme

legal-docs-types

The Case Law Explorer API's data contract, as TypeScript.

No client, no requests, no credentials. Import it anywhere — including browser code, which needs these shapes to build a query and render a result but must never be able to call the API directly.

npm install legal-docs-types
import type { RechtspraakQueryParameters, RechtspraakDocument } from "legal-docs-types";
import { DocType, INSTANCES_OPTIONS } from "legal-docs-types";

Why this is separate

Its consumers need different things:

| Consumer | Needs | |---|---| | vue-legal-query-builder | the query shapes, to build one | | vue-legal-docs-visualizer | the document shapes, to render them | | node-legal-docs-client | both, plus the means to make the request | | go-legal-docs-client | its own Go equivalents |

The first two run in a browser. Shipping them a client would mean shipping a credential into a page, where anyone using it can read the key and — worse — use it to make whatever calls they like. Keeping the contract in its own package means browser code can be given exactly what it needs and nothing more.

Requests belong to a server: node-legal-docs-client for TypeScript, go-legal-docs-client for Go.

What is in here

Types describing the API's requests and responses, and the constants that are part of the contract:

  • DocType — document types the Rechtspraak endpoint accepts
  • INSTANCES_OPTIONS, DOMAINS_OPTIONS — the court instances and legal domains a query can filter on
  • ECHR_ARTICLES_OPTIONS — the Convention articles

Those are values rather than types, so this package is not quite "types only". They are here because they describe what the API accepts, and a consumer forced to redefine them would be redefining the contract.

Versioning

This package describes somebody else's API. When that API changes, this changes with it, and every client should move together. Treat a change here as a change to all of them.