Validator for Amazon States Language JSON files.
npm install @wmfs/statelintAn npm package providing a validator for Amazon States Language JSON files. Usable from the command-line or as a library.
This package is derived from Amazon Web Services Labs' awslabs/statelint and is up to date with Amazon States Language as of September 7, 2023.
sh
npm install --global @wmfs/statelint
`$3
`javascript
statelint state-machine-spec [state-machine-spec...]
`There are no options. If you see no output, your state machine is fine.
As a library
$3
`sh
npm install --save @wmfs/statelint
`$3
`javascript
const stateLint = require('@wmfs/statelint')const problems = stateLint.validate(json)
if (problems.length !== 0) {
console.log('Oh dear!')
problems.forEach(p => console.log(
ERROR: ${p})
}
`*
json is 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 Bug reports and pull requests are welcome on GitHub. Please be aware of our Code of Conduct