Registry / devops / kdlfmt

kdlfmt

JSON →
library0.1.7jsnpmunverified

kdlfmt is a code formatter for KDL documents, wrapping the official kdl-rs Rust parser. Current stable version is 0.1.7, released periodically on npm, Cargo, Homebrew, and via precompiled binaries. Supports both KDL v1 and v2 specifications; by default tries v2 then v1. Key differentiators: thin CLI wrapper with lint-style check subcommand, config file support, and stdin/stdout piping. Unlike general document formatters, kdlfmt is purpose-built for KDL and leverages the canonical Rust parser for correctness.

npm install kdlfmt
INSTALL
IMPORT
SIG · KDLFMT
K
kdlfmt
devopsjavascriptv0.1.7
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Installs kdlfmt globally via npm and demonstrates format, check, stdin/stdout, and version selection.

npm install -g kdlfmt # Format a file kdlfmt format input.kdl # Format a directory kdlfmt format . # Check formatting (non-zero exit if unformatted) kdlfmt check input.kdl # Read from stdin, print to stdout cat input.kdl | kdlfmt format - # Specify KDL version (v1 or v2) kdlfmt format --kdl-version v2 input.kdl
Debug
Known issues
gotchaKDL v2 is not 100% backward compatible with v1. By default, kdlfmt tries v2 first, which may change formatting of valid v1 documents.
fix
Specify --kdl-version v1 explicitly when formatting KDL v1 documents to avoid unintended changes.
affects: >=0.1.0
gotchaThe 'format' command with stdin requires using '-' as the input path; without it, stdin is ignored.
fix
Use: cat file.kdl | kdlfmt format -
affects: >=0.1.0
Errors
Common errors & fixes
Error: Unrecognized option: '--check'
Using --check flag instead of the 'check' subcommand.
fix
Use 'kdlfmt check PATH' instead of 'kdlfmt --check PATH'
kdlfmt: command not found
kdlfmt not installed or not in PATH.
fix
Run 'npm install -g kdlfmt' or install via cargo/brew/precompiled binary.
Upgrade
Version history
0.1.7latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
9 hits · last 30 days
node
8
Resources
packagekdlfmt
kdlfmt — npm install kdlfmt · libregistry