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

@metabase/representations

v1.1.5

Published

Metabase representation format specification and schema validator

Readme

Metabase Representation Format

Metabase represents user-created content as a tree of YAML files. Each file represents one entity (a collection, card, dashboard, etc.). The format is designed to be portable across Metabase instances: numeric database IDs are replaced with human-readable names and entity IDs.

This repository contains the specification and examples for the Metabase Representation Format.

Contents

  • core-spec/v1/spec.md — Full specification (v1.0.0) covering entity keys, folder structure, MBQL and native queries, parameters, and all entity types.
  • core-spec/v1/schemas/ — YAML schemas (JSON Schema format) for each entity type.
  • examples/v1/ — Complete examples using the Sample Database.

Entity Types

| Entity | Description | |--------|-------------| | Collection | Folder-like container for organizing content | | Card | Question, model, or metric — holds an MBQL or native query | | Dashboard | Grid layout of cards with filter parameters and tabs | | Segment | Saved filter definition scoped to a table | | Measure | Saved aggregation definition scoped to a table | | Snippet | Reusable SQL fragment for native queries | | Transform | Materializes query or Python script results into a database table | | TransformTag | Label for categorizing transforms (built-in or custom) | | TransformJob | Scheduled job that executes tagged transforms | | PythonLibrary | Shared Python source file available to Python transforms |

Schema Validation

CLI

Validate a folder of YAML files against the schemas:

npx @metabase/representations validate-schema --folder ./my-export

Omit --folder to validate the current directory.

Extracting the spec

Copy the bundled spec.md to a target file:

npx @metabase/representations extract-spec --file ./spec.md

Omit --file to write spec.md into the current directory.

Extracting schemas

Copy the bundled schemas (preserving folder structure) into a target directory:

npx @metabase/representations extract-schema --folder ./schemas

Omit --folder to extract into the current directory.

Programmatic

import { validateSchema } from "@metabase/representations";

const { results, passed, failed } = validateSchema({
  folder: "./my-export",
});

for (const result of results) {
  if (result.status === "fail") {
    console.log(result.file, result.errors);
  }
}

Publishing to NPM

Releases are published automatically by the Release to NPM GitHub Actions workflow on every push to main. The workflow compares the version in package.json against the version published on npm and publishes (with the latest dist-tag) if they differ.

To cut a release, bump version in package.json and merge to main.

The workflow requires an NPM_RELEASE_TOKEN secret with publish access to the @metabase npm org.