https://github.com/aaronhuggins/js-edi
Next-gen EDI parser in Antlr4 grammar compiled by antlr4ts
https://github.com/aaronhuggins/js-edi
antlr4 edi edifact grammars javascript js-edi parser typescript x12
Last synced: 9 months ago
JSON representation
Next-gen EDI parser in Antlr4 grammar compiled by antlr4ts
- Host: GitHub
- URL: https://github.com/aaronhuggins/js-edi
- Owner: aaronhuggins
- License: mit
- Created: 2021-03-02T17:22:26.000Z (about 5 years ago)
- Default Branch: main
- Last Pushed: 2021-04-15T19:57:12.000Z (almost 5 years ago)
- Last Synced: 2025-04-06T11:46:16.990Z (11 months ago)
- Topics: antlr4, edi, edifact, grammars, javascript, js-edi, parser, typescript, x12
- Language: TypeScript
- Homepage:
- Size: 1.82 MB
- Stars: 17
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# JS-EDI
Work in progress, not fit for production use. Parser for both EDIX12 and EDIFACT leveraging Antlr4 grammar.
If I could call it J-EDI, I would. May the force be with you.
[](https://sonarcloud.io/dashboard?id=ahuggins-nhs_js-edi) [](https://sonarcloud.io/dashboard?id=ahuggins-nhs_js-edi) [](https://sonarcloud.io/dashboard?id=ahuggins-nhs_js-edi) [](https://sonarcloud.io/dashboard?id=ahuggins-nhs_js-edi)
# Features
- Support for EDI X12 and EDIFACT
- Parse natively in JS to a document object model (DOM)
- Generate from a constructed dom
- Query the dom using element selectors
- Traverse as a hierarchical dom
- Transform to and from JS objects
- Serialize to and from JSON EDI notation
- Validate parsed EDI using JSON Schema
# What's done prior to alpha so far
- EDI X12 support; parser in antlr4ts is fully functional, detects component and repeated elements
- Document object model, supports detecting difference between EDI flavors and complexe nodes
- Validator, works with the DOM to be able to validate a document with JSON Schema
- Element selector query language
# Known TO-DOs
## Before alpha release
- Complete initial documentation
## Before beta release
- Improve accuracy of parsing/handling EDIFACT
- Better service string advice detection
- Conform to EDIFACT standard with "release indicator"
- Conform to EDIFACT charactar sets better (technically only UNOA and UNOB supported for now)
## Before release candidate
- Add custom eventing in document parser
- Events for each node type generated
- on errors
- on parse start and stop
- Stabilize
- Finish writing tests
# Roadmap
- Complete EDIFACT support and optimize grammar
- Stabilize all APIs
- Expose listener APIs
- Write examples
- Make tests more broadly specific to the parsing of grammars(??)