Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/generalmimon/js-yaml-parsers-test
Compare YAML parsers in JavaScript for use in Kaitai Struct
https://github.com/generalmimon/js-yaml-parsers-test
Last synced: 26 days ago
JSON representation
Compare YAML parsers in JavaScript for use in Kaitai Struct
- Host: GitHub
- URL: https://github.com/generalmimon/js-yaml-parsers-test
- Owner: generalmimon
- License: mit
- Created: 2024-01-24T13:44:46.000Z (10 months ago)
- Default Branch: master
- Last Pushed: 2024-05-21T22:04:13.000Z (6 months ago)
- Last Synced: 2024-05-21T23:22:49.840Z (6 months ago)
- Language: JavaScript
- Size: 48.8 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Test JavaScript YAML parsers
Compare 3 YAML parsers available in the JS ecosystem:
* https://github.com/jeremyfa/yaml.js
* https://github.com/nodeca/js-yaml
* https://github.com/eemeli/yaml## Usage
* `./run.sh` - runs test cases specified in [index.js](./index.js) on all YAML parsers, resulting in log files written to [results/](./results/):
```
results/
├── js-yaml.txt
├── yaml-1.1.txt
├── yaml-1.2.txt
└── yamljs.txt
```* `./gen-results-diffs.sh` - generates the [results-diffs/](./results-diffs/) folder with diffs between logs in [results/](./results/)
* `./parse.sh ` - parses 3 sets of YAML files, converts them to JSON and writes `.json` files to `out/`:
* https://github.com/kaitai-io/kaitai_struct_formats
* https://github.com/kaitai-io/kaitai_struct_tests/tree/master/formats
* https://github.com/kaitai-io/kaitai_struct_tests/tree/master/formats_errRequires the `` parameter (path to a full clone of https://github.com/kaitai-io/kaitai_struct).
The resulting folder structure looks like this:
```
out/
├── js-yaml/
│ ├── ksf/
│ ├── kst/
│ └── kst_err/
├── yaml-1.1/
│ └── ...
├── yaml-1.2/
│ └── ...
└── yamljs/
└── ...
```This makes it easy to compare the results of YAML parsers between each other, for example:
```
git diff --no-index -- out/{yamljs,js-yaml}/
```