Skip to content

arbre-app/read-gedcom

Folders and files

NameName
Last commit message
Last commit date

Latest commit

cf7db18 · Jun 26, 2022

History

71 Commits
Jun 21, 2022
Jun 26, 2022
Sep 15, 2021
Jun 24, 2022
Jun 24, 2022
Sep 14, 2021
Jun 29, 2021
Sep 13, 2020
Nov 30, 2021
Jun 26, 2022
Jun 26, 2022
Sep 11, 2021
Sep 14, 2021
Jun 22, 2022
Jun 21, 2022
Jun 21, 2022

Repository files navigation

read-gedcom

A Gedcom file reader written in Typescript. See the documentation.

Features

  • Tolerant parsing
    • Character encoding detection (ASCII, CP1252, UTF-8, UTF-16, CP850, and more)
    • Good effort of parsing and interpreting non-standard data
  • Near full specification coverage
    • Mostly Gedcom 5.5.5 compliant while being as much backward compatible as possible
    • Parser for dates in any standard calendars
  • Unopinionated API
    • We provide the API, but the user has full control over the interpretation of the data
    • It's also possible to not use the API, in which case it can be shaken off the tree
  • Strongly typed
  • Zero dependencies; compatible on browser and Node.js
    • Less than 20kB gzipped
  • ...and more:
    • Conversion of dates
    • Serialization-friendly
    • Progress tracking for larger files

Installation and Usage

npm install read-gedcom
import { readGedcom } from 'read-gedcom';

const promise = fetch('https://mon.arbre.app/gedcoms/royal92.ged')
  .then(r => r.arrayBuffer())
  .then(readGedcom);

promise.then(gedcom => {
  console.log(gedcom.getHeader().toString());
});

Or, if you simply want to include it as a javascript file, this is also possible:

<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/read-gedcom/dist/read-gedcom.min.js"></script>
<script>
    const promise = fetch('https://mon.arbre.app/gedcoms/royal92.ged')
            .then(r => r.arrayBuffer())
            .then(Gedcom.readGedcom);

    promise.then(gedcom => {
        console.log(gedcom.getHeader().toString());
    });
</script>

Documentation

Bug report

A Gedcom file isn't parsed correctly? Please open a ticket!

Also make sure to attach a zipped version of the bogus Gedcom file. If you don't want to publicly share the file, you may send it to this email address; we will create a minimal reproducible example based on what you sent us, which can be safely shared.