Given a data structure, generate GEDCOM text output.
This module expects the data structure output by the parse-gedcom library.
npm i generate-gedcom -S
const astToGedcom = require('generate-gedcom')
This module exports a single function that takes an array of GEDCOM data and returns a string.
Example
const input = pointer: '' tag: 'HEAD' data: '' tree: pointer: '' tag: 'SOUR' data: 'Millennial Children' tree: pointer: '' tag: 'VERS' data: 'V5.5' tree: pointer: '' tag: 'CHAR' data: 'UNICODE' tree: pointer: '@I1@' tag: 'INDI' data: '' tree: pointer: '' tag: 'NAME' data: 'Pie /Cakeson/' tree: const expectedOutput = `0 HEAD1 SOUR Millennial Children2 VERS V5.51 CHAR UNICODE0 @I1@ INDI1 NAME Pie /Cakeson/` // => expectedOutput