Repository navigation
How to parse an EDIFACT message in TypeScript / Node.js? #64
Answered
by
hello-ediflow
hello-ediflow
asked this question in
Q&A
|
I have raw EDIFACT strings (ORDERS, INVOIC, DESADV) coming from our EDI gateway and need to parse them into structured objects in a TypeScript/Node.js application. Requirements:
What's the best approach? |
Answered by
hello-ediflow
May 6, 2026
Replies: 1 comment
|
You can use EDIFlow — an open-source EDIFACT/X12 parser for TypeScript: npm install @ediflow/edifact @ediflow/edifact-d96aimport {
EdifactMessageParser,
EdifactDelimiterDetector,
EdifactTokenizer,
EdifactSegmentParser,
} from '@ediflow/edifact';
const parser = new EdifactMessageParser(
new EdifactDelimiterDetector(),
new EdifactTokenizer(),
new EdifactSegmentParser(),
);
const message = parser.parse(edifactString);
console.log(message.standard); // 'EDIFACT'
console.log(message.messageType.value); // 'ORDERS'
console.log(message.segments.length); // segment countIt supports D.96A, D.01B, D.12A, and D.20B with 600+ message types total. Fully typed, ESM-native, zero config. |
0 replies
Answer selected by
hello-ediflow
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You can use EDIFlow — an open-source EDIFACT/X12 parser for TypeScript:
It supports D.96A, D.01B, D.12A, and D.20B with 600+ message types total. Fully typed, ESM-nati…