An npm package providing a validator for Amazon States Language JSON files. Usable from the command-line or as a library.
From the Command-line
npm install --global @wmfs/statelint
statelint state-machine-spec state-machine-spec...
There are no options. If you see no output, your state machine is fine.
As a library
npm install --save @wmfs/statelint
const stateLint =const problems = stateLintif problemslength !== 0consoleproblems
jsonis the state machine to validate as a JSON object.
stateLint.validate returns an array or error strings. If the array is empty, the state machine is fine. If not, then there's a problem! The validator is exhaustive, so it will report every problem it finds, not simply bail at the first thing. The error messages have the general form
<json-path to error> <description of error>.
Bug reports and pull requests are welcome on GitHub. Please be aware of our Code of Conduct
Licensed under the terms of the MIT license. Copyright (c) 2018 West Midlands Fire Service