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 🙏

© 2025 – Pkg Stats / Ryan Hefner

gedcom-d3

v2.0.9

Published

A GEDCOM parser, which translates GEDCOM (.ged) files into D3 capable JSON. This package is specifically designed to prepare data for use in https://github.com/oh-kay-blanket/blood-lines

Readme

gedcom-d3

A parser and converter for GEDCOM (.ged) files, producing D3-capable JSON for genealogy visualization, especially with 3d-force-graph.


Installation

npm install --save gedcom-d3

API

parse(gedcomString)

  • Input: A string containing GEDCOM data.
  • Output: An array of parsed GEDCOM objects (tree structure).

d3ize(tree)

  • Input: The output of parse() (GEDCOM tree array).
  • Output: An object with the following structure:
    • nodes: Array of person nodes, each with properties like id, name, surname, gender, dob, yob, color, bio, etc.
    • links: Array of relationship links (parent/child, spouse, etc.), with source, target, and relationship type.
    • families: Array of family groupings from the GEDCOM data.
    • surnameList: Array of unique surnames with color assignments.

Usage Example

import { parse, d3ize } from 'gedcom-d3'
import gedcomFile from './gedcoms/sample_ancestors.ged'

const tree = parse(gedcomFile)
const d3Data = d3ize(tree)
// d3Data.nodes and d3Data.links can be fed into 3d-force-graph or similar D3 visualizations

Node & Link Structure

Node (Person)

  • id: Unique identifier (GEDCOM pointer)
  • name: Full name
  • firstName, surname: Parsed name parts
  • gender: 'M' or 'F'
  • dob, yob: Date/year of birth
  • dod, yod: Date/year of death
  • pob, pod: Place of birth/death
  • families: Array of family objects
  • color: Assigned color for surname
  • bio: Biographical notes (if present)
  • ...and more, depending on GEDCOM tags

Link (Relationship)

  • source: Source person id
  • target: Target person id
  • sourceType, targetType: Relationship roles (e.g., 'HUSB', 'WIFE', 'CHIL')
  • type: Relationship type (e.g., 'MARR', 'DIV', or parentage)

Updating & Publishing the NPM Package

1. Make your changes

  • Edit code, update version in package.json (see semver).

2. Test locally (optional but recommended)

  • In another project, run:
    npm install /path/to/gedcom-d3
  • Or use npm link for local development.

3. Commit and push your changes

git add .
git commit -m "Describe your changes"
git push

4. Bump the version

  • For a patch, minor, or major update:
    npm version patch   # or 'minor' or 'major'
    git push && git push --tags

5. Publish to NPM

  • Log in if you haven't:
    npm login
  • Publish:
    npm publish
  • For scoped packages (not needed here):
    npm publish --access public

6. Verify


License

ISC


Contributing

Pull requests and issues welcome! See oh-kay-blanket/gedcom-d3.


Credits