Stately.js is a JavaScript based finite-state machine (FSM) engine for Node.js and the browser.