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

@domorium/validator

v2.0.0

Published

GEDCOM 5.5.1 and 7.0 parser and validator

Readme

@domorium/validator

npm License: MIT

GEDCOM 5.5.1 and 7.0 parser and validator. Parses .ged files into an AST and validates structure, cardinality, and payload types against the official GEDCOM specification schemas.

Part of Domorium — GEDCOM editor tooling for the browser, Obsidian, VS Code, and JetBrains IDEs.

Install

npm install @domorium/validator

Usage

import { GedcomDocument } from "@domorium/validator";

const gedcomString = "0 HEAD\n1 GEDC\n2 VERS 7.0\n0 TRLR\n";

const document = new GedcomDocument().createDocument(gedcomString);
const errors = document.getErrors();

Fragments

A fenced block in a note, an example in documentation, a selection: text that is part of a document rather than one of its own.

const block = new GedcomDocument().createDocument(text, {
  fragment: true,
  dialect: "7.0",
});

What goes quiet is what the boundary caused — the header and trailer, a pointer leaving the text, an extension tag with no HEAD.SCHMA to declare it in. Everything else is still read. dialect is needed because a fragment carries no HEAD.GEDC.VERS.

Diagnostics

getErrors() returns GedcomError[]:

import type { GedcomError, Position, Range } from "@domorium/validator";

interface GedcomError {
  code: string;
  message: string;
  hint?: string;
  data?: { xref?: string; requiredRecordTag?: string; expectedLevel?: number };
  range: Range;
  level: "error" | "warning" | "info";
}

data carries the facts a quick fix is built from — which xref failed to resolve, and what record tag it needed.

Match on code rather than on message; messages are written for people and change. GedcomErrorCode is exported for this:

import { GedcomErrorCode } from "@domorium/validator";

const unresolved = errors.filter(
  (error) => error.code === GedcomErrorCode.UnresolvedXref,
);

| Code | Member | Reported when | | ----------------- | ----------------------- | ------------------------------------------------------------------------------ | | VAL001 | UnknownTag | a tag the schema does not define in this position | | VAL002 | MissingTag | a structure the schema requires is absent | | VAL003 | MissingValue | the payload is absent where one is required | | VAL004 | IncorrectValue | the payload does not match its data type | | VAL005 | ShouldBeSetValue | the payload is not one of the permitted values | | VAL006 | MissingRef | a pointer payload that is not written as a pointer | | VAL007 | ManyOccurrences | more occurrences than the cardinality allows | | VAL008 | UndocumentedTag | a GEDCOM 7 extension tag with no HEAD.SCHMA declaration | | VAL009 | DuplicateDeclaration | a tag declared more than once in HEAD.SCHMA | | VAL010 | EmptyEvent | an event with neither a payload nor substructures | | VAL011 | UnsupportedVersion | the version is one no schema in this package describes | | VAL012 | UndeterminedVersion | no version could be read from HEAD.GEDC.VERS | | VAL013 | SubstitutedVersion | a version checked against a different version's schema | | VAL014 | ImpossibleDay | a date naming a day its calendar does not have, such as 31 FEB | | VAL015 | PersonalAncestralFile | a header naming SYST before GEDC, so the file is a Personal Ancestral File | | unresolved-xref | UnresolvedXref | an xref naming no record of the required type | | invalid-level | InvalidLevel | a level that cannot follow the line above it | | LEXER | Lexer | the text could not be tokenized | | PARSER | Parser | the tokens could not be assembled into a tree |

Scripts

| Command | Description | | ------------------- | -------------------------------------------------------- | | npm run build | Build library (CJS + ESM + types) | | npm run watch | Build in watch mode | | npm test | Run tests | | npm run typecheck | Type-check without emitting | | npm run generate | Regenerate g7validation.json from upstream GEDCOM spec |