0.0.3 • Published 9 years ago
yval v0.0.3
yval
Validator, Translator and Formatter for YAML, JSON, and Others
Synopsis
# Check if a YAML file is well-formed:
> yval file.yaml
# Validate a YAML file against a schema:
> yval file.yaml --schema=myformat.schemat
# Validate a YAML file against a schema:
> yval file.yaml --schema=myformat.schematDescription
The yval tool is a validator, translator and formatter for YAML, JSON, CSV and TSV data.
Installation
The yval command is currently written in NodeJS. To install it, run:
> npm install -g yvalUsage
The yval command takes a data file as input and:
- With no options, loads it and reports whether it is well-formed
- With
--schema=...option will lint/validate it against a schema - With
--to=...option will write data to stdout in the specified format
If input data is valid, yval will return 0 as the exit code; else it will return 1.
Command Options
The yval command has the following options:
-s,--schema=<file>To useyvalas a linter/validator, specify a schema file. Supports theschematandjson-schemaformats. See Below.-t,--to=<format>With this option,yvalwill format the input data into the specified format and write it to stdout. Valid formats are:yaml,json,csvandtsv. This option can be used along with the--schemaoption.-f,--from=<format>Explicitly specify the input format. Usuallyyvalcan correctly guess the input format. Use this option when it can't. Valid formats are:yaml,json,csvandtsv. This option can be used along with the--schemaoption.-q,--quietSuppress all validation output. Use this when you only care about the translation output, and/or theyvalexit code.
See Also
- "Schemat"<...>
- "JSON Schema"<...>