statelint
An npm package providing a validator for Amazon State Language JSON files. Usable from the command-line or as a library.
This package is derived from awslabs/statelint.
Command-line Usage
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.
Library Usage
npm install --save @wmfs/statelint
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. It can be a JSON object, a filename, or a file descriptor.
stateLine.validate
returns an array, which contains descriptions of any validation errors found. If the array is empty, the state machine is fine.
Contributing
Bug reports and pull requests are welcome on GitHub. Please be aware of our Code of Conduct
License
Licensed under the terms of the MIT license. Copyright (c) 2018 West Midlands Fire Service