{"id":18832389,"url":"https://github.com/brainpoint/febs-fsm","last_synced_at":"2025-08-23T02:32:46.102Z","repository":{"id":57234188,"uuid":"249335407","full_name":"brainpoint/febs-fsm","owner":"brainpoint","description":"Finite state machine","archived":false,"fork":false,"pushed_at":"2020-04-14T07:39:32.000Z","size":28,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-08-09T06:16:08.216Z","etag":null,"topics":["concurrent","febs","finite-state-machine","fsm","mechine","state","ts-fsm"],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/brainpoint.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-03-23T04:28:37.000Z","updated_at":"2020-04-14T07:39:34.000Z","dependencies_parsed_at":"2022-09-15T02:52:00.113Z","dependency_job_id":null,"html_url":"https://github.com/brainpoint/febs-fsm","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/brainpoint/febs-fsm","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brainpoint%2Ffebs-fsm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brainpoint%2Ffebs-fsm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brainpoint%2Ffebs-fsm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brainpoint%2Ffebs-fsm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/brainpoint","download_url":"https://codeload.github.com/brainpoint/febs-fsm/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brainpoint%2Ffebs-fsm/sbom","scorecard":{"id":250737,"data":{"date":"2025-08-11","repo":{"name":"github.com/brainpoint/febs-fsm","commit":"789246062a30319c68c7ff31997e187fa986ef52"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3,"checks":[{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Code-Review","score":0,"reason":"Found 0/4 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}}]},"last_synced_at":"2025-08-17T08:24:50.366Z","repository_id":57234188,"created_at":"2025-08-17T08:24:50.367Z","updated_at":"2025-08-17T08:24:50.367Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271732383,"owners_count":24811312,"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","status":"online","status_checked_at":"2025-08-23T02:00:09.327Z","response_time":69,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["concurrent","febs","finite-state-machine","fsm","mechine","state","ts-fsm"],"created_at":"2024-11-08T01:57:43.854Z","updated_at":"2025-08-23T02:32:46.080Z","avatar_url":"https://github.com/brainpoint.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# Finite state machine.\n\n## Install\n\n```js\nnpm i febs-fsm\n```\n\n`write in Typescript`.\n\n## Example\n\n```js\nimport {\n  State, \n  StateEvent, \n  StateMechine\n} from 'febs-fsm';\n\n// Define Event1.\nclass Event1 extends StateEvent {\n  constructor() {\n    super('Event1');\n  }\n}\n\n// Define State1.\nclass State1 extends State {\n  constructor() {\n    super('State1');\n    this.addTransition('Event1', 'State2');\n  }\n  async onProcess( event:StateEvent, nextState:State ):Promise\u003c{transition:boolean, ret?:any}\u003e {\n    return {transition: true};\n  }\n}\n\n// Define State2.\nclass State2 extends State {\n  constructor() {\n    super('State2');\n  }\n  async onProcess( event:StateEvent, nextState:State ):Promise\u003c{transition:boolean, ret?:any}\u003e {\n    return {transition: false};\n  }\n}\n\n\n// Define mechine.\nclass Mechine extends StateMechine {\n  constructor() {\n    super('State1');  // init state identify.\n    this.addState(new State1());\n    this.addState(new State2());\n  }\n}\n\nlet mechine = new Mechine();\nawait mechine.initiate(); // initiate.\nmechine.process_event(new Event1());  // process_event.\n```\n\n## Standard FSM\n\n[standard](./lib/standard/readme.md): Store current state in mechine object. This applies to situations such as chat rooms.\n\n```js\nimport {\n  State, \n  StateEvent, \n  StateMechine\n} from 'febs-fsm';\n```\n\n### Concurrent FSM\n\n[concurrent](./lib/concurrent/readme.md): Use the FSM concurrently. It isnot store current state in mechine object. Use context to pass the current state to FSM. Avoidance of repetition to set up FSM object.\n\n```js\nimport {\n  State, \n  StateEvent, \n  StateMechine\n} from 'febs-fsm/concurrent';\n```\n\n### Identify\n\nThe Identify of state or event use string name:\n\n```js\n// State1.\nclass State1 extends State {\n  get identify():string { return 'State1'; }\n}\n```\n\n### State process flow\n\n1. Execute `curState.onProcess`. It will do as follow, if function return `{transition:true, ret?:any}`.\n2. Execute `curState.onLeave`\n3. Change curState to nextState.\n3. Execute `nextState.onEnter`\n\n#### onProcess: {transition:boolean, ret:any}\n\n  - transition: Indicates whether can to transition to nextState.\n  - ret: Any value\n\n#### onEnter: any\n  - return a any value.\n\nIt will return the `'onEnter return value'` or `'onProcess.ret'`,  When call `process_event`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrainpoint%2Ffebs-fsm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbrainpoint%2Ffebs-fsm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrainpoint%2Ffebs-fsm/lists"}