event-protocol: Extract lib, executable npm package #151
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Details
The lib is just a single function:
Motivation and Context
Library: Some programs (such as cucumber-gui) may want to validate incoming events before they are processed.
CLI: Being able to use the validator as a CLI is easier when it can just be
npm install
ed. This makes it easier for developers of event producers to test that they are producing valid events.The CLI reads events from
STDIN
and writes them toSTDOUT
, which makes it possible to use it just likecat
in between two programs (a producer and a consumer).If the CLI fails to parse or validate an event, a detailed error message is written to
STDERR
in red and stops processing further events.How Has This Been Tested?
As before - just run
make
. Change an event (or a schema) and runmake
again to see it fail.Types of changes
Checklist: