All Projects → ChristopheBougere → asl-validator

ChristopheBougere / asl-validator

Licence: Apache-2.0 license
A simple Amazon States Language validator based on JSON schemas.

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to asl-validator

workflow-manager
Minimal Workflow orchestrator for AWS Step Functions
Stars: ✭ 20 (-69.7%)
Mutual labels:  state-machine, aws-step-functions
Trapheus
This tool automates restoration of RDS database instances from snapshots into any dev, staging or production environments. It supports individual RDS Snapshot as well as cluster snapshot restore operations.
Stars: ✭ 68 (+3.03%)
Mutual labels:  state-machine, aws-step-functions
FiniteStateMachine
This project is a finite state machine designed to be used in games.
Stars: ✭ 45 (-31.82%)
Mutual labels:  state-machine
aws-step-functions-long-lived-transactions
Deal with the complexities of dealing with a long lived transaction across distributed components in your microservices architecture using AWS Step Functions.
Stars: ✭ 109 (+65.15%)
Mutual labels:  aws-step-functions
use-state-machine
Use Finite State Machines with React Hooks
Stars: ✭ 28 (-57.58%)
Mutual labels:  state-machine
smacha
SMACHA is a meta-scripting, templating, and code generation engine for rapid prototyping of ROS SMACH state machines.
Stars: ✭ 15 (-77.27%)
Mutual labels:  state-machine
M2A01 MuSimpron
Small yet powerful state machine coroutine library
Stars: ✭ 34 (-48.48%)
Mutual labels:  state-machine
tsm
A Hierarchical State Machine Framework in C++
Stars: ✭ 30 (-54.55%)
Mutual labels:  state-machine
fsm2
FMS2 provides Dart implementation of the core design aspects of the UML state diagrams.
Stars: ✭ 44 (-33.33%)
Mutual labels:  state-machine
kstatemachine
KStateMachine is a Kotlin DSL library for creating finite state machines (FSM) and hierarchical state machines (HSM).
Stars: ✭ 63 (-4.55%)
Mutual labels:  state-machine
tstate-machine
TypeScript implementation of State Manager(like StateMachine)
Stars: ✭ 20 (-69.7%)
Mutual labels:  state-machine
xstate
State machines and statecharts for the modern web.
Stars: ✭ 21,286 (+32151.52%)
Mutual labels:  state-machine
pastafarian
A tiny event-based finite state machine
Stars: ✭ 20 (-69.7%)
Mutual labels:  state-machine
UT Framework
Various advanced tools built for Unreal Engine 4
Stars: ✭ 45 (-31.82%)
Mutual labels:  state-machine
workflow-activerecord
ActiveRecord/Rails Integration for the Workflow library
Stars: ✭ 24 (-63.64%)
Mutual labels:  state-machine
qp-arduino
QP real-time embedded frameworks/RTOS for Arduino (AVR and SAM)
Stars: ✭ 37 (-43.94%)
Mutual labels:  state-machine
terraform-aws-step-functions
Terraform module which creates Step Functions on AWS 🇺🇦
Stars: ✭ 29 (-56.06%)
Mutual labels:  aws-step-functions
Flapi
Flapi is an API generator for Java, which generates 'smart' interfaces for improved fluency in your code.
Stars: ✭ 56 (-15.15%)
Mutual labels:  state-machine
simple-state-machine
A simple Java state machine for Spring Boot projects
Stars: ✭ 25 (-62.12%)
Mutual labels:  state-machine
statebot-sh
Statebot for shell-scripts. Write more robust and understandable programs.
Stars: ✭ 14 (-78.79%)
Mutual labels:  state-machine

asl-validator

license npm version

NPM

A simple Amazon States Language validator based on JSON schemas. It also validates JSON paths syntax in InputPath, OutputPath and ResultPath.

When writing your state machine (for AWS step functions), you can't locally validate you state machine definition without creating it. asl-validator makes it possible.

Install

# Use via the CLI
npm install -g asl-validator
# Use in your code
npm install asl-validator

CLI

$ asl-validator --help

  Usage: asl-validator [options]

  Amazon States Language validator


  Options:

    -v, --version                       output the version number
    --json-definition <jsonDefinition>  JSON definition
    --json-path <jsonPath>              JSON path
    --silent                            silent mode
    -h, --help                          output usage information

Return status:

  • 0 if state machine definition is valid
  • 1 if state machine definition is invalid
  • 2 if an exception occurs

In your code

const aslValidator = require('asl-validator');
const definition = require('./path/to/my/state/machine/json/definition');
const { isValid, errors, errorsText } = aslValidator(definition);
if (isValid) {
  console.log('✓ State machine definition is valid')
} else {
  // Either go through the errors object
  console.error('✕ State machine definition is invalid:', errors.map(({ message }) => message).join('\n'));
  // Or display the preformatted errors text
  console.error('✕ State machine definition is invalid:', errorsText('\n'));
}

Test

npm run test

Lint

npm run lint

See also

License

See LICENSE.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].