Getting Started β
iata-ssim is a zero-dependency TypeScript parser for IATA Standard Schedules Information Manual (SSIM) data formats. Today it implements Chapter 7 β Schedule Data Set (.ssim files); SSM / ASM / SCR are coming soon.
30-second example β
ts
import { parseScheduleDataSet } from 'iata-ssim/sds'
const dataSet = parseScheduleDataSet(text)
const block = dataSet.carriers[0]!
console.log(`${block.carrier.airlineDesignator} β ${block.flightLegs.length} legs`)
// β "SU β 3370 legs"
const leg = block.flightLegs[0]!
console.log(`${leg.airlineDesignator}${leg.flightNumber} ${leg.departure.station}β${leg.arrival.station}`)
// β "SU006 SVOβLED"
console.log(leg.daysOfOperation)
// β [2, 3, 4, 6, 7] (ISO weekdays, 1=Mon)
if (dataSet.warnings.length > 0) {
for (const w of dataSet.warnings)
console.warn(`[${w.rule}] line ${w.lineNumber}:${w.column}: ${w.message}`)
}The parser accepts any UTF-8 string (BOM is stripped automatically; \n and \r\n line endings both work). Reading the file is your responsibility β that keeps the library platform-agnostic.
In Node β
ts
import { readFile } from 'node:fs/promises'
import { parseScheduleDataSet } from 'iata-ssim/sds'
const text = await readFile('schedule.ssim', 'utf-8')
const dataSet = parseScheduleDataSet(text)In the browser β
ts
import { parseScheduleDataSet } from 'iata-ssim/sds'
document.querySelector('input[type=file]')!.addEventListener('change', async (e) => {
const file = (e.target as HTMLInputElement).files?.[0]
if (!file)
return
const dataSet = parseScheduleDataSet(await file.text())
console.log(`${dataSet.carriers[0]?.flightLegs.length ?? 0} flight legs`)
})For more β fetch(), streaming large files, drag-and-drop β see Parsing SDS β In the browser.
Next steps β
- Installation β pnpm/npm, CDN
<script>tag, scoped imports - Validation β what the spec validator checks (and how to use strict mode)
- SDS deep dive β full record-type reference, field offsets, error handling
- Playground β drop a
.ssimfile in your browser and inspect the result