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

@haneinfo/metadata-schema

v1.1.41

Published

Readme

@haneinfo/metadata-schema

@haneinfo/metadata-schema exposes the Prisma DMMF used by an app through GET /metadata/schema. The response includes scalar and enum fields, relation metadata, database column names, and structured annotations parsed from Prisma /// documentation comments.

Prisma documentation tags

Tags are case-sensitive. @cubeMeasure and @cubeRef are line-oriented: they are recognised only when they start a documentation line, after optional whitespace. @internal is the exception (see below). A description can follow the tag on the same line, or appear on separate /// lines. The original documentation value in the metadata response is preserved byte-for-byte; parsing adds structured properties without removing tag text.

@internal

Place @internal anywhere in a model's documentation to exclude that model from the derived availableScopes list; package Prisma fragments put it at the end of the model's first /// line. The model and its metadata are still exposed in models; only the scope derivation filters it out.

/// @internal
/// Framework bookkeeping; not part of the public data scopes.
model AuditLog {
  id String @id @default(cuid())
}

@cubeMeasure <hint>

Place @cubeMeasure on a scalar or enum field and provide one non-whitespace hint. The current recommended dictionary is sum, avg, min, max, and count, but measureHint is an open string so future Cube measures such as countDistinct, countDistinctApprox, and runningTotal can be used without a package type change. The parser does not validate whether the field type is appropriate for the hint. Consumers should ignore or warn on unknown hints rather than failing the whole query.

model InvoiceLine {
  id     String  @id @default(cuid())
  /// @cubeMeasure sum Line amount in the invoice currency.
  amount Decimal
}

@cubeRef <app>.<Model>.<field>

Place @cubeRef on a field that refers to a field owned by another app. The three dot-separated parts are returned as crossAppRef: { app, model, field }. Parsing is syntactic only: the app, model, and field do not need to exist in the current repository. Cross-app joins are never inferred when this tag is absent.

model Shipment {
  id              String @id @default(cuid())
  /// @cubeRef sales.Order.id
  /// The order identifier is owned by the sales app.
  salesOrderId    String @map("sales_order_id")
}

Tags can be combined on one field and can be mixed with ordinary text:

model Payment {
  id        String  @id @default(cuid())
  /// Payment amount in the settlement currency.
  /// @cubeMeasure sum
  /// @cubeRef billing.Invoice.total
  amount    Decimal @map("amount_value")
}

Malformed @cubeMeasure or @cubeRef lines are ignored and produce a warning. Lowercase variants such as @cubemeasure are ordinary text. If a tag appears more than once on a field, the first valid occurrence wins. A tag string embedded in the middle of a sentence is not a tag; move it to the beginning of a /// documentation line.