edifact-parser
EDIFACT parser based on the edi npm package, focused on ease of use and code legibility
Instalation
Use npm to install edifact-parser
npm install edifact-parser
Usage
const EDI = ;const doc = "edifact document here...";const segments = doc;const messages = doc;const mbatch = messages0;const sbatch = segments0;
Methods
messages
mbatch; // UNH first elementmbatch; // UNH second element, zero componentmbatch; // BGM first element, zero componentmbatch; // BGM second elementmbatch; // MKS first element
segments
UNB
sbatch;sbatch;
BGM
sbatch;sbatch;sbatch;
DTM
sbatch;sbatch;sbatch;sbatch;sbatch;sbatch;sbatch;
RFF
sbatch;sbatch;sbatch;sbatch;sbatch;sbatch;sbatch;sbatch;
NAD
sbatch;sbatch;sbatch;sbatch;sbatch;sbatch;sbatch;sbatch;sbatch;sbatch;sbatch;sbatch;
CUH
sbatch;
UNS
sbatch;
CNT
sbatch;sbatch;
UNT
sbatch;
UNZ
sbatch;
Product(s) information
methods return a list by default, returns a single element if an int param is defined (zero-based)
LIN
sbatch;
PIA
sbatch;sbatch;sbatch;
QTY
sbatch;sbatch;
PRI
sbatch;sbatch;sbatch;sbatch;