Skip to content

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 ​

optionwhat it does
--format <name>text (default), json, sarif, html, markdown, junit
--jsonthe 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, --quietprint no report (files are still written)

Checks ​

optionwhat 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-emptya file without any code is fine (exit 0, not 2)
--pages 1,3only 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 ​

codewhen
0every code looks right
1something to check or fix (see --fail-on)
2no 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.

MIT licensed. It predicts from the artwork; it is not a verifier.