{"bugs":{"url":"https://github.com/statelyai/xstate/issues"},"dist":{"shasum":"58ff2460fc07d020d7a4661cac2723656fc3caff","tarball":"https://registry.npmjs.org/@xstate/fsm/-/fsm-3.0.0-alpha.0.tgz","fileCount":10,"integrity":"sha512-wUIU/2seI1qK8EqFQgpMo7BhoI8Rt3kdA0JTiIotmE92bAJfMO0ahTt2zz2u9GTR7AmlCASkcxIBoS3/xEKkcw==","signatures":[{"sig":"MEYCIQCdE94CIkWDvK/WKNy8e72KuU7mub5sXR6Kb2UF2T5FXQIhAKf7dzHzoejIqHJh9DWuhfMcYNAq7Q9gGayhZDip15zd","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":47202,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjudHOACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmoiwg/9GirIj1O/sF01JmT0VzTczRzflq3svmJgZwx96+zV+9+yQvAb\r\n4c7a/2MxfzVXWEshOLXSIg63LS5H14EYtXXPW1tMnynSM9MOVL/aGoSNQV/z\r\n7VgXUWXt5t/sg33Ay5KUNGXbovxsVHEgmnC1DfXgWF9WVVhJ3tR8NwTkCHk+\r\nFZxIj/KEF4Aff8dIGT1BksqfMkxV3LqQ6Ns4LYqsdFopw1/YTClaVwGlKAJY\r\nrrlrkrBuAm63w9GezEXxyIp6PZzn9JuO5VvBygPISTQG+RrKW5pWC5zltp90\r\naHM3J8oEKgQ7pVhSqWIXmixdc6t1RrA7y2MLDCW7H/44+CPdU12QGCyp446J\r\nSYpVMzFsqZ+8VwQ1ayI+pCORq2/Isotb9sX3rejYpCZQQQnOQE8flXEzjO1T\r\ntGbGTzjM4b4gF9Tyxmg3YjHeviXjqBG/TzKGB65WOHk2DzAcidCd38A83Ej3\r\nsIfAG+1FEMb2mPX8s/Ffx3N/lYHKrmmX5OYcGYpCxtqKZ+b30KYJk6KiSM77\r\nhFQJpKjqVV/aKqLLLPkzwxh254qdUCg1gTE5UVovL4jGPui4ZkXU1XzTJOfy\r\nRRUfGmEzqv0N5hESqqQ+VTe/BCrbZPm8HxWLHHbJxTFiNbUHSKbr6XbBXRkb\r\ndKpG2eqBqyjPZoXQpQplVKTWicnLaiOrgkg=\r\n=7OeV\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/xstate-fsm.cjs.js","name":"@xstate/fsm","types":"./dist/xstate-fsm.cjs.d.ts","author":{"name":"David Khourshid","email":"davidkpiano@gmail.com"},"module":"dist/xstate-fsm.esm.js","readme":"# @xstate/fsm\n\n<p align=\"center\">\n  <a href=\"https://xstate.js.org\">\n  <br />\n  <img src=\"https://i.imgur.com/j4x2zzX.png\" alt=\"XState FSM\" width=\"200\"/>\n  <br />\n    <sub><strong>XState for Finite State Machines</strong></sub>\n  <br />\n  <br />\n  </a>\n</p>\n\nThis package contains a minimal, 1kb implementation of [XState](https://github.com/statelyai/xstate) for **finite state machines**.\n\n- [Read the full documentation in the XState docs](https://xstate.js.org/docs/packages/xstate-fsm/).\n- [Read our contribution guidelines](https://github.com/statelyai/xstate/blob/main/CONTRIBUTING.md).\n\n## Features\n\n|                             | **@xstate/fsm** | [XState](https://github.com/statelyai/xstate) |\n| --------------------------- | :-------------: | :-------------------------------------------: |\n| Finite states               |       ✅        |                      ✅                       |\n| Initial state               |       ✅        |                      ✅                       |\n| Transitions (object)        |       ✅        |                      ✅                       |\n| Transitions (string target) |       ✅        |                      ✅                       |\n| Delayed transitions         |       ❌        |                      ✅                       |\n| Eventless transitions       |       ❌        |                      ✅                       |\n| Nested states               |       ❌        |                      ✅                       |\n| Parallel states             |       ❌        |                      ✅                       |\n| History states              |       ❌        |                      ✅                       |\n| Final states                |       ❌        |                      ✅                       |\n| Context                     |       ✅        |                      ✅                       |\n| Entry actions               |       ✅        |                      ✅                       |\n| Exit actions                |       ✅        |                      ✅                       |\n| Transition actions          |       ✅        |                      ✅                       |\n| Parameterized actions       |       ❌        |                      ✅                       |\n| Transition guards           |       ✅        |                      ✅                       |\n| Parameterized guards        |       ❌        |                      ✅                       |\n| Spawned actors              |       ❌        |                      ✅                       |\n| Invoked actors              |       ❌        |                      ✅                       |\n\n- Finite states (non-nested)\n- Initial state\n- Transitions (object or strings)\n- Context\n- Entry actions\n- Exit actions\n- Transition actions\n- `state.changed`\n\nIf you want to use statechart features such as nested states, parallel states, history states, activities, invoked services, delayed transitions, transient transitions, etc. please use [`XState`](https://github.com/statelyai/xstate).\n\n## Quick start\n\n### Installation\n\n```bash\nnpm i @xstate/fsm\n```\n\n### Usage (machine)\n\n```js\nimport { createMachine } from '@xstate/fsm';\n\nconst toggleMachine = createMachine({\n  id: 'toggle',\n  initial: 'inactive',\n  states: {\n    inactive: { on: { TOGGLE: 'active' } },\n    active: { on: { TOGGLE: 'inactive' } }\n  }\n});\n\nconst { initialState } = toggleMachine;\n\nconst toggledState = toggleMachine.transition(initialState, { type: 'TOGGLE' });\ntoggledState.value;\nconst untoggledState = toggleMachine.transition(toggledState, {\n  type: 'TOGGLE'\n});\nuntoggledState.value;\n// => 'inactive'\n```\n\n### Usage (service)\n\n```js\nimport { createMachine, interpret } from '@xstate/fsm';\n\nconst toggleMachine = createMachine({});\n\nconst toggleService = interpret(toggleMachine).start();\n\ntoggleService.subscribe((state) => {\n  console.log(state.value);\n});\n\ntoggleService.send({ type: 'TOGGLE' });\ntoggleService.send({ type: 'TOGGLE' });\ntoggleService.stop();\n```\n","exports":{".":{"module":"./dist/xstate-fsm.esm.js","default":"./dist/xstate-fsm.cjs.js"},"./package.json":"./package.json"},"gitHead":"8dd88311090f4d45ee192d91c5e49e3a67df0beb","license":"MIT","scripts":{},"_npmUser":{"name":"xstate-release-bot","email":"david@stately.ai"},"homepage":"https://github.com/statelyai/xstate/tree/main/packages/xstate-fsm#readme","keywords":["state","machine","scxml","state","machine","finite","state","machine","fsm","automata"],"repository":{"url":"git+ssh://git@github.com/statelyai/xstate.git","type":"git"},"_npmVersion":"8.19.2","description":"XState for finite state machines","directories":{},"maintainers":[{"name":"xstate-release-bot","email":"david@stately.ai"},{"name":"andarist","email":"mateuszburzynski@gmail.com"},{"name":"davidkpiano","email":"davidkpiano@gmail.com"}],"sideEffects":false,"_nodeVersion":"16.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{},"_npmOperationalInternal":{"tmp":"tmp/fsm_3.0.0-alpha.0_1673122254286_0.957594381934908","host":"s3://npm-registry-packages"},"_id":"@xstate/fsm@3.0.0-alpha.0","version":"3.0.0-alpha.0"}