{"author":{"name":"Dominic Tarr","email":"dominic.tarr@gmail.com","url":"http://bit.ly/dominictarr"},"name":"fsm","description":"check finite state machine properties","version":"1.0.1","homepage":"https://github.com/dominictarr/fsm","repository":{"type":"git","url":"git://github.com/dominictarr/fsm.git"},"scripts":{"test":"node test/index.jss"},"devDependencies":{"tape":"~2.12.3","pull-stream":"~2.23.0"},"dependencies":{"split":"~0.3.0"},"gitHead":"7dd3dcd369ac1f3a5625c2f1b4ccbd3dc2282e4e","bugs":{"url":"https://github.com/dominictarr/fsm/issues"},"_id":"fsm@1.0.1","_shasum":"859204e37427e1784f9a112ec828fad504944d41","_from":".","_npmVersion":"1.4.26","_npmUser":{"name":"dominictarr","email":"dominic.tarr@gmail.com"},"maintainers":[{"name":"dominictarr","email":"dominic.tarr@gmail.com"}],"dist":{"shasum":"859204e37427e1784f9a112ec828fad504944d41","tarball":"http://registry-npm.ywwl.com/fsm/download/fsm-1.0.1.tgz","integrity":"sha512-aHXN4eR1FxyBMa+Nw4rbt8z9672Vi7QD4kIG/oHDwW7G3dt9+w/12Jxay8PrLV00bTY+s4YoerMqw7xOmFc/jw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDi9Mm5yISrxccoVx3BVnCwY4zZmP7XN3wt/9OflczVxQIgFclcTQA13yTxX12lXbi2jq54YZMN/k32DkXi7ZogV+Q="}],"size":5409,"noattachment":false,"key":"/fsm/-/fsm-1.0.1.tgz"},"directories":{},"readme":"# fsm\n\ncheck properties of finite state machines.\n\nThere is a lot of academic research in this area, yet this module is very simple.\nThere are a lot of fancy tools available, but they are not easy to use.\nIf idea is really useful, then I think a very simple tool should be viable.\n\n## License\n\nMIT\n\n# Example\n\nDefine FSM as json, here is a stream with 4 states.\nThis FSM expresses the constraint that the stream *must not*\nemit 'data' when paused, and also that it *must not* emit\ndata after 'end'.\n\n``` js\n{\n  START: {\n    data   : 'START',\n    pause  : 'PAUSED',\n    end    : 'END',\n    error  : 'ERROR'\n  },\n  PAUSED: {\n    pause  : 'PAUSED',\n    resume : 'START',\n    error  : 'ERROR'\n  },\n  ERROR: {},\n  END: {}\n}\n```\n\nwe can check a number of properties of this machine.\ndoes this machine halt? (and in the right place?)\ncan you reach every state from every other?\n\n## API\n\n### validate (fsm)\n\ncheck that all transitions are to defined states.\n\n### reachable (fsm)\n\ncalculate all states can reach each other states.\nthe result is in the form of\n\n``` js\n{STATE1: {STATE2: [event path from S1 to S2]}}\n```\n\n### terminal (fsm)\n\nreturn the list of states that cannot reach another state.\n\nalias: `deadlock'\n\n### livelock (fsm, [terminal])\n\nget list of states that cannot reach a terminal state.\n\n### combine(fsm1, fsm2, start1, start2)\n\ncombine two fsm into one, obeying all the transitions in each.\nTODO: throw an error if there are transitions that are impossible in the combined machine.\n\n\n","publish_time":1410768937182,"_cnpm_publish_time":1410768937182,"dist-tags":{"latest":"1.0.2"}}