Skip to content
Discussion options

You must be logged in to vote

EDIFlow has a dedicated EANCOM 2002 data package with all 50 GS1 retail message types:

npm install @ediflow/edifact @ediflow/eancom-2002
import {
  EdifactMessageParser,
  EdifactDelimiterDetector,
  EdifactTokenizer,
  EdifactSegmentParser,
} from '@ediflow/edifact';

const parser = new EdifactMessageParser(
  new EdifactDelimiterDetector(),
  new EdifactTokenizer(),
  new EdifactSegmentParser(),
);

const desadv = parser.parse(eancomDesadvString);

console.log(desadv.messageType.value);  // 'DESADV'

// Access NAD segments for GLN identifiers
const parties = desadv.segments.filter(s => s.tag === 'NAD');
for (const party of parties) {
  console.log(`${party.elements[0]?.value}: GLN ${party.

Replies: 1 comment

Comment options

You must be logged in to vote
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
Category
Q&A
Labels
None yet
1 participant