{"id":13517488,"url":"https://github.com/soixantecircuits/awesome-fsm","last_synced_at":"2025-04-10T09:26:47.252Z","repository":{"id":141352380,"uuid":"50185795","full_name":"soixantecircuits/awesome-fsm","owner":"soixantecircuits","description":"Awesome list for Finite State Machine","archived":false,"fork":false,"pushed_at":"2016-01-22T14:35:55.000Z","size":3,"stargazers_count":7,"open_issues_count":0,"forks_count":0,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-05-19T20:13:06.009Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/soixantecircuits.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-01-22T14:23:36.000Z","updated_at":"2023-08-18T15:39:04.000Z","dependencies_parsed_at":null,"dependency_job_id":"ff69508b-f57c-4f3a-b6e9-95cbdf9cac5c","html_url":"https://github.com/soixantecircuits/awesome-fsm","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/soixantecircuits%2Fawesome-fsm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/soixantecircuits%2Fawesome-fsm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/soixantecircuits%2Fawesome-fsm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/soixantecircuits%2Fawesome-fsm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/soixantecircuits","download_url":"https://codeload.github.com/soixantecircuits/awesome-fsm/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248190853,"owners_count":21062354,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-01T05:01:34.299Z","updated_at":"2025-04-10T09:26:47.224Z","avatar_url":"https://github.com/soixantecircuits.png","language":null,"funding_links":[],"categories":["Technical"],"sub_categories":["awesome-*"],"readme":"# Awesome FSM [![Awesome](https://cdn.rawgit.com/sindresorhus/awesome/d7305f38d29fed78fa85652e3a63e154dd8e8829/media/badge.svg)](https://github.com/sindresorhus/awesome)\n\n[\u003cimg src=\"https://upload.wikimedia.org/wikipedia/commons/thumb/9/9d/DFAexample.svg/500px-DFAexample.svg.png\" align=\"right\" width=\"100\"\u003e](https://en.wikipedia.org/wiki/Finite-state_machine)\n\n\u003e Useful resources for creating apps that use the [finite state machine](https://en.wikipedia.org/wiki/Finite-state_machine) pattern\n\n*Inspired by the [awesome](https://github.com/sindresorhus/awesome) list thing.*\n\n## Préambule 🌭\n\nFinite state machine won't save the world. This pattern address issues where you want to drive a user from a point A to Z following various state. Thus make sure you really need a state machine before using one. But also make sure you won't need one, because most of the time **you will**.\nWe have **four rules** that leads this design:\n\n1. The state machine is defined by a finite number of states\n2. This states are triggered by conditions\n3. Each conditions shapes **transition**\n4. The machine is in **only one state at a time**; we call it the current state\n\n## Interesting reading about state machine 📖\n\n- [FSM and event driven programming](http://www.robert-drummond.com/2015/04/21/event-driven-programming-finite-state-machines-and-nodejs/)\n\n\u003e FSM can be simply compared to somebody with amnesia who is constantly asking:\n\u003e Where am I?\n\u003e What just happened?\n\u003e and…\n\u003e\n\u003e So what do I do (or where do I go) next?\n\n*Robert Drummond*\n\n- [State design pattern](http://www.dofactory.com/javascript/state-design-pattern)\n\n\u003e Two other examples where the State pattern is useful include: vending machines that dispense products when a correct combination of coins is entered, and elevator logic which moves riders up or down depending on certain complex rules that attempt to minimize wait and ride times.\n\n*dofactory*\n\n- [Hacker news thread](https://news.ycombinator.com/item?id=2949543)\n\n\u003e This man has never heard of video game A.I. programming :)\n\n*davedx*\n\n- [gameprogrammingpatterns.com](http://gameprogrammingpatterns.com/state.html)\n\n\u003e There’s nothing to prevent “air jumping” — keep hammering B while she’s in the air, and she will float forever. The simple fix is to add an isJumping_ Boolean field to Heroine that tracks\n\n*Robert Nystrom*\n\n- [Why developers never use state machines](http://www.skorks.com/2011/09/why-developers-never-use-state-machines/)\n\n\u003e We Don't Need One Until We Do\n\u003e So, early on you don't feel like your objects' state machine behaviour is complex enough to warrant a **\"full-blown\"** state machine (YAGNI and all that jazz), but later on – **when it IS complex enough** – you feel like you've invested too much time/effort to replace it with something that has equivalent functionality\n\n*Alan Skorkin*\n\n- [About React and State Machine](https://facebook.github.io/react/docs/interactivity-and-dynamic-uis.html)\n\n\u003e React thinks of UIs as simple state machines.\n\n\n\n## Libraries 📚\n\n- State.js: https://github.com/steelbreeze/state.js [\u003cimg src=\"https://img.shields.io/npm/dt/state.js.svg\" align=\"right\"\u003e](https://www.npmjs.com/package/state.js)\n- Machina.js: https://github.com/ifandelse/machina.js [\u003cimg src=\"https://img.shields.io/npm/dt/machina.svg\" align=\"right\"\u003e](https://www.npmjs.com/package/machina)\n- Javascript State Machine: https://github.com/jakesgordon/javascript-state-machine [\u003cimg src=\"https://img.shields.io/npm/dt/javascript-state-machine.svg\" align=\"right\"\u003e](https://www.npmjs.com/package/javascript-state-machine)\n- Promise State Machine: https://github.com/patbenatar/promise-state-machine [\u003cimg src=\"https://img.shields.io/npm/dt/promise-state-machine.svg\" align=\"right\"\u003e](https://www.npmjs.com/package/promise-state-machine)\n- Chine: https://github.com/mtabini/chine [\u003cimg src=\"https://img.shields.io/npm/dt/chine.svg\" align=\"right\"\u003e](https://www.npmjs.com/package/chine)\n- Machineto: https://github.com/itkoren/machineto [\u003cimg src=\"https://img.shields.io/npm/dt/machineto.svg\" align=\"right\"\u003e](https://www.npmjs.com/package/machineto)\n- Makina: https://github.com/atabel/makina [\u003cimg src=\"https://img.shields.io/npm/dt/makina.svg\" align=\"right\"\u003e](https://www.npmjs.com/package/makina)\n- StateJS: https://github.com/hufyhang/state-js [\u003cimg src=\"https://img.shields.io/npm/dt/state-js.svg\" align=\"right\"\u003e](https://www.npmjs.com/package/state-js)\n- Mistic: https://github.com/benaston/mistic [\u003cimg src=\"https://img.shields.io/npm/dt/mistic.svg\" align=\"right\"\u003e](https://www.npmjs.com/package/mistic)\n- fluent-state-machine: https://github.com/nickuraltsev/fluent-state-machine [\u003cimg src=\"https://img.shields.io/npm/dt/fluent-state-machine.svg\" align=\"right\"\u003e](https://www.npmjs.com/package/fluent-state-machine)\n- Bon Etat: https://github.com/gausby/bon-etat [\u003cimg src=\"https://img.shields.io/npm/dt/bon-etat.svg\" align=\"right\"\u003e](https://www.npmjs.com/package/bon-etat)\n- Hierarchical-fsm: https://github.com/cassiozen/State-Machine [\u003cimg src=\"https://img.shields.io/npm/dt/hierarchical-fsm.svg\" align=\"right\"\u003e](https://www.npmjs.com/package/hierarchical-fsm)\n- iFsm - jQuery: https://github.com/intersel/iFSM [\u003cimg src=\"https://img.shields.io/npm/dt/ifsm.svg\" align=\"right\"\u003e](https://www.npmjs.com/package/ifsm)\n- State flow: https://github.com/philipdev/stateflow [\u003cimg src=\"https://img.shields.io/npm/dt/stateflow.svg\" align=\"right\"\u003e](https://www.npmjs.com/package/stateflow)\n\n## Examples\n\nTODO 🛠\n\n\n\n\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsoixantecircuits%2Fawesome-fsm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsoixantecircuits%2Fawesome-fsm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsoixantecircuits%2Fawesome-fsm/lists"}