Find it on JSR
Import from jsr:
deno add jsr:@brian-greeson/igc-parser
Provide a filepath to an IGC file.
import { igcParser } from '@brian-greeson/igc-parser';
const igcData = igcParser({ filepath: "./path/to/igc/file.igc" });
console.log(
Or provide the string contents of the file directly.
import { igcParser } from "@brian-greeson/igc-parser";
const igcString = await Deno.readTextFile("./path/to/igc/file.igc");
const igcData = igcParser({ igcString });
Note
If you provide both a string and path, the parser will ignore the string and read directly from the file
Do something with the data
import { igcParser } from "@brian-greeson/igc-parser";
const igcString = await Deno.readTextFile("./path/to/igc/file.igc");
const igcData = await igcParser({ igcString });
const { metadata, trackPoints } = igcData;
console.log("metadata:", metadata);
console.log("trackPoints:", trackPoints);