Hierarchical state machines implementation in JavaScript heavily inspired by the QP active object framework, see http://www.state-machine.com/. See the README file for details.
The implementation is JavaScript engine agnostic and works both in browsers and in NodeJS.