Gathering detailed insights and metrics for @xstate/fsm
Gathering detailed insights and metrics for @xstate/fsm
Gathering detailed insights and metrics for @xstate/fsm
Gathering detailed insights and metrics for @xstate/fsm
Actor-based state management & orchestration for complex app logic.
npm install @xstate/fsm
Typescript
Module System
Node Version
NPM Version
99.7
Supply Chain
99.5
Quality
80
Maintenance
100
Vulnerability
100
License
@xstate/store@3.8.0
Updated on Jun 29, 2025
@xstate/store@3.7.1
Updated on Jun 26, 2025
@xstate/store@3.7.0
Updated on Jun 21, 2025
@xstate/react@6.0.0
Updated on Jun 19, 2025
@xstate/vue@5.0.0
Updated on Jun 19, 2025
@xstate/svelte@5.0.0
Updated on Jun 19, 2025
TypeScript (97.98%)
Vue (0.78%)
JavaScript (0.48%)
Svelte (0.42%)
CSS (0.26%)
HTML (0.08%)
Total Downloads
68,331,250
Last Day
37,665
Last Week
1,117,303
Last Month
4,661,518
Last Year
39,072,633
MIT License
28,421 Stars
6,806 Commits
1,315 Forks
191 Watchers
296 Branches
346 Contributors
Updated on Jul 04, 2025
Minified
Minified + Gzipped
Latest Version
2.1.0
Package Id
@xstate/fsm@2.1.0
Unpacked Size
55.77 kB
Size
10.59 kB
File Count
17
NPM Version
8.19.4
Node Version
16.20.0
Published on
Jun 21, 2023
Cumulative downloads
Total Downloads
Last Day
8.4%
37,665
Compared to previous day
Last Week
-6.9%
1,117,303
Compared to previous week
Last Month
7.1%
4,661,518
Compared to previous month
Last Year
209.3%
39,072,633
Compared to previous year
XState for Finite State Machines
This package contains a minimal, 1kb implementation of XState for finite state machines.
@xstate/fsm | XState | |
---|---|---|
Finite states | ✅ | ✅ |
Initial state | ✅ | ✅ |
Transitions (object) | ✅ | ✅ |
Transitions (string target) | ✅ | ✅ |
Delayed transitions | ❌ | ✅ |
Eventless transitions | ❌ | ✅ |
Wildcard transitions | ✅ | ✅ |
Nested states | ❌ | ✅ |
Parallel states | ❌ | ✅ |
History states | ❌ | ✅ |
Final states | ❌ | ✅ |
Context | ✅ | ✅ |
Entry actions | ✅ | ✅ |
Exit actions | ✅ | ✅ |
Transition actions | ✅ | ✅ |
Parameterized actions | ❌ | ✅ |
Transition guards | ✅ | ✅ |
Parameterized guards | ❌ | ✅ |
Spawned actors | ❌ | ✅ |
Invoked actors | ❌ | ✅ |
state.changed
If 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
.
1npm i @xstate/fsm
1import { createMachine } from '@xstate/fsm'; 2 3const toggleMachine = createMachine({ 4 id: 'toggle', 5 initial: 'inactive', 6 states: { 7 inactive: { on: { TOGGLE: 'active' } }, 8 active: { on: { TOGGLE: 'inactive' } } 9 } 10}); 11 12const { initialState } = toggleMachine; 13 14const toggledState = toggleMachine.transition(initialState, 'TOGGLE'); 15toggledState.value; 16const untoggledState = toggleMachine.transition(toggledState, 'TOGGLE'); 17untoggledState.value; 18// => 'inactive'
1import { createMachine, interpret } from '@xstate/fsm'; 2 3const toggleMachine = createMachine({}); 4 5const toggleService = interpret(toggleMachine).start(); 6 7toggleService.subscribe((state) => { 8 console.log(state.value); 9}); 10 11toggleService.send('TOGGLE'); 12toggleService.send('TOGGLE'); 13toggleService.stop();
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
30 commit(s) and 9 issue activity found in the last 90 days -- score normalized to 10
Reason
GitHub workflow tokens follow principle of least privilege
Details
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
Found 17/20 approved changesets -- score normalized to 8
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
Reason
project is not fuzzed
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Reason
101 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-06-23
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More