Command line
sh
npx barcode-grader <file|folder|pattern>... [options]A file, a folder (every .pdf .png .jpg .jpeg .svg in it, at any depth) or a pattern such as "artwork/**/*.pdf". Patterns are expanded by the tool, so quote them; they work the same on Windows.
Report
| option | what it does |
|---|---|
--format <name> | text (default), json, sarif, html, markdown, junit |
--json | the same as --format json |
-o, --output <file> | write the report to a file |
--report <name>=<file> | write one more report; repeat it or join with commas: --report html=report.html,sarif=barcodes.sarif |
-q, --quiet | print no report (files are still written) |
Checks
| option | what it does |
|---|---|
--fail-on <level> | what makes the exit code 1: check (default), fail, never |
--min-grade <A-D> | a code predicted below this grade will likely fail |
--allow-empty | a file without any code is fine (exit 0, not 2) |
--pages 1,3 | only these pages of a PDF (default: all, up to 40) |
--width <mm> | a picture's printed width, when the file has no resolution |
--dpi <n> | a picture's resolution, overriding the file's |
--process <name> | print process, for the bar width reduction note: flexo, offset, gravure, digital |
Exit codes
| code | when |
|---|---|
| 0 | every code looks right |
| 1 | something to check or fix (see --fail-on) |
| 2 | no code in a file (see --allow-empty), no file matched, or a file couldn't be read |
Colour is used in a terminal; set NO_COLOR to turn it off.