Getting Started
⚠ Bavary is currently not stable and heavily under development.
The API might change and all 0.0.x
releases should be treated as test / preview releases.
Install via npm:
$ npm install bavary
Install via yarn:
$ yarn add bavary
Include directly via jsdelivr:
Usage
; // Compile definitionsconst parse = ; // Use compiled definitions to parse a stringconst parsed = ; // Logs "A" to the consoleconsole;
The function compile
accepts as second argument a config object;
Getting started
Check out the documentation to get started or jump directly into one of the examples:
- string - Parsing strings and support escaped quotes.
- hex-color - Parsing different kinds of color types in the hexadecimal format.
- number - Parsing floats and integers with optional scientific notation.
CLI
Usage:
$ bvc [files] [options...]
Where files
can be any kind of directory, file or glob-pattern.
If no output file is specified (via --output
) it'll print the result to the console.
Flag | Explanation | Example |
---|---|---|
-w, --watch |
Watches source-files matched by [files] |
$ bva src/**/*.bv input.txt --watch |
-v, --version |
Prints the current version | $ bva --version |
-o, --output <file> |
Write results to disk | $ bva --output result.json |
-p, --prettify |
Prettify result (Works only in combination with --output ) |
$ bva --output result.json --prettify |
-h, --help |
Shows usage info | $ bva --help |