Skip to content
This repository was archived by the owner on Sep 15, 2021. It is now read-only.

TrueCommerce/node-x12

Folders and files

NameName
Last commit message
Last commit date

Latest commit

8b7902c · Jan 18, 2018

History

59 Commits
Mar 21, 2016
Apr 29, 2016
Apr 29, 2016
Mar 21, 2016
Mar 21, 2016
Mar 8, 2016
Jan 18, 2018
Apr 25, 2016
Mar 21, 2016
Apr 29, 2016
Mar 21, 2016

Repository files navigation

NOTE: This project is no longer being maintained!

X12

A simple ASC X12 parser for NodeJS. Created originally for the TC Toolbox project.

Usage

'use strict';

import { X12Parser, X12QueryEngine } from 'x12/core';

// parse (deserialize) X12 EDI
let parser = new X12Parser(true);
let interchange = parser.parseX12('...raw X12 data...');

// OR use the query engine to query a document
// Syntax Documentation: https://github.com/TrueCommerce/node-x12/wiki/x12queryengine-api#element-reference-syntax
let engine = new X12QueryEngine(parser);
let results = engine.query('REF02:REF01["IA"]');

results.forEach((result) => {
    // do something with each result
    
    // result.interchange
    // result.functionalGroup
    // result.transaction
    // result.segment
    // result.element(.value)
});