{"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.2","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":"862f27b2efafdbec5272590d87fd21420b356f16","bugs":{"url":"https://github.com/dominictarr/fsm/issues"},"_id":"fsm@1.0.2","_shasum":"e2eb9b29747e806bbb90f8d5453e2f9d7bd23783","_from":".","_npmVersion":"1.4.26","_npmUser":{"name":"dominictarr","email":"dominic.tarr@gmail.com"},"maintainers":[{"name":"dominictarr","email":"dominic.tarr@gmail.com"}],"dist":{"shasum":"e2eb9b29747e806bbb90f8d5453e2f9d7bd23783","tarball":"http://registry-npm.ywwl.com/fsm/download/fsm-1.0.2.tgz","integrity":"sha512-kkH3dVTCkXyo7o3IR9Gzp18+b9gmWsQdAsGd72FOdBzbHJ6GSJqNfOPXjZlU1LIdrb8OfbVRIsrveOV+LnUz5A==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCnh75umiklRvpZniFMAMF+GGMtCyhx7zyEZvMCaOi/sQIgQ6tLG0yN8b4V1281DVKFR1TtGSBVa0tSV3ce3hHmk/o="}],"size":5366,"noattachment":false,"key":"/fsm/-/fsm-1.0.2.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":1411033934594,"_cnpm_publish_time":1411033934594,"dist-tags":{"latest":"1.0.2"}}