npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@ediflow/cli

v0.3.0

Published

EDIFlow Command Line Interface - Parse, Build & Validate EDI messages

Readme

@ediflow/cli

EDIFlow Command Line Interface - Parse, Build, Validate & Export Schemas for EDI messages from the command line.

🆕 What's New in v0.3.0

  • X12 Support — Parse, validate, build and export-schema for X12 (850, 810, 837, 856, ...)
  • HIPAA Support — Healthcare 837P/837I/835 via @ediflow/hipaa-x12-005010
  • EANCOM Support — GS1 retail standard via @ediflow/eancom-2002
  • Business Object output--output-type business-object with --property-parse-mode
  • Build from Business Object — JSON with --key-style option
  • --key-stylecode | name | camelCase | snake_case | kebab-case (aligns with --property-parse-mode)

🎯 Overview

This package provides a CLI wrapper around @ediflow/core with support for EDIFACT, X12, EANCOM and HIPAA.

Clean Architecture:

  • Presentation Layer: CLI commands (ParseCommand, BuildCommand, ValidateCommand, ExportSchemaCommand)
  • Infrastructure Layer: DI Container that wires format-specific parsers

📦 Installation

npm install -g @ediflow/cli

🚀 Usage

Parse EDI Message

# Parse EDIFACT from file
ediflow parse examples/cli/edifact/parse/input/orders.edi

# Parse X12 — output as Business Object with camelCase keys
ediflow parse examples/cli/x12/parse/input/purchase-order-850.edi --output-type business-object --property-parse-mode camelCase

# Auto-detect standard, output JSON
ediflow parse message.edi -o output.json

Build EDI Message

# Build EDIFACT from raw JSON (segments)
ediflow build examples/cli/edifact/build/input/orders.json

# Build X12 850 from Business Object JSON with camelCase keys
ediflow build examples/cli/x12/build/input/purchase-order-850-business-object-camel.json --key-style camelCase

Validate EDI Message

# Validate EDIFACT
ediflow validate examples/cli/edifact/validate/input/orders.edi

# Validate X12 with strict mode
ediflow validate examples/cli/x12/validate/input/purchase-order-850.edi --strict

Export Schema

# Export X12 004010 850 as JSON Schema
ediflow export-schema --standard X12 --version 004010 --type 850

# Export EDIFACT D.20B ORDERS as YAML
ediflow export-schema --standard EDIFACT --version D.20B --type ORDERS --format yaml

🏗️ Architecture

@ediflow/cli
├── src/
│   ├── presentation/cli/
│   │   ├── commands/          # CLI Commands (Presentation Layer)
│   │   │   ├── ParseCommand.ts
│   │   │   ├── BuildCommand.ts
│   │   │   ├── ValidateCommand.ts
│   │   │   └── ExportSchemaCommand.ts
│   │   └── utils/             # CLI Utilities
│   │       ├── ErrorHandler.ts
│   │       └── OutputFormatter.ts
│   ├── infrastructure/
│   │   └── container/         # DI Container (wires format packages)
│   │       └── DIContainer.ts
│   └── index.ts               # CLI Entry Point
└── test/
    └── e2e/                   # End-to-End CLI Tests

🔌 Dependencies

  • @ediflow/core - Core domain & application logic
  • @ediflow/edifact - EDIFACT parser & builder
  • @ediflow/x12 - X12 parser & validator
  • commander - CLI framework

📝 Examples

📖 See CLI Examples on GitHub for a comprehensive guide with all commands, options, and runnable examples for EDIFACT, X12, EANCOM, and HIPAA.

Each use case has input/ and result/ files you can run directly.

🧪 Testing

npm test           # all tests (unit + e2e)
npm run test:e2e   # end-to-end only

📄 License

MIT