igc-parser is a JavaScript/TypeScript library designed for parsing IGC flight log files, a standard format used for recording flights in gliders, balloons, and other unpowered aircraft. The current stable version is 2.0.0. The project maintains an active development pace, with releases occurring periodically to introduce enhancements and address breaking changes, as seen with versions 0.5.0, 1.0.0, 1.1.0, and 2.0.0. Key differentiators include its robust handling of various IGC record types (such as A, B, H, L records), support for specific extensions like LAD/LOD for B records, GeoDatum handling, and parsing of TZN timezone headers. It also offers a `lenient` parsing option, allowing processing of files even with minor errors. The library ships with comprehensive TypeScript type definitions, making it well-suited for modern TypeScript projects.
npm install igc-parserVerified import paths — ran on the pinned version, not inferred.
Demonstrates how to parse an IGC flight log string, including reading from a temporary file, handling the parsing options (e.g., `lenient` mode), and logging key extracted information like flight date, pilot, glider type, and fix details.
Upgrade your Node.js environment to version 12 or higher. It is recommended to use a Node.js version currently in active LTS.
If you encounter new parsing errors with existing IGC files, try enabling the `lenient: true` option in the `parse` function: `parse(content, { lenient: true });`. Additionally, review your IGC files to ensure they strictly conform to the IGC specification for 'A' records.Always use named imports for ESM (`import { parse } from 'igc-parser';`) or destructuring for CommonJS (`const { parse } = require('igc-parser');`) if you wish to directly access the `parse` function.For CommonJS, use object destructuring to correctly import the named `parse` export: `const { parse } = require('igc-parser');`.Use a named import for the `parse` function: `import { parse } from 'igc-parser';`.Pass the `{ lenient: true }` option to the `parse` function to allow it to continue processing even with minor formatting errors: `parse(content, { lenient: true });`. If errors persist, thoroughly review and correct the IGC file's structure.No dependency data recorded yet.