Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

jssm

Package Overview
Dependencies
Maintainers
1
Versions
324
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jssm

A Javascript state machine with a simple API. Well tested, and typed with Flowtype. MIT License.

  • 1.0.0
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

jssm

A Javascript state machine with a simple API. Well tested, and typed with Flowtype. MIT license.

TL;DR

Specify finite state machines with a brief syntax. Run them. Derive charts from them. Save and load states. Make factories. Impress friends and loved ones. Cure corns and callouses.

const traffic_light = new jssm.machine({

  initial_state : 'Red',

  transitions   : [
    { action: 'Proceed', from:'Green',  to:'Yellow' },
    { action: 'Proceed', from:'Yellow', to:'Red'    },
    { action: 'Proceed', from:'Red',    to:'Green'  }
  ]

});

traffic_light.state();            // 'Red'
traffic_light.action('Proceed'); 
traffic_light.state();            // 'Yellow'
traffic_light.action('Proceed'); 
traffic_light.state();            // 'Green'

![](docs/ryg traffic light console screenshot.png)

Quick Start

Why

How To

Other state machines

There are a lot of state machine impls for JS, many quite a bit more mature than this one. Here are some options:

  1. Finity 😮
  2. Stately.js
  3. machina.js
  4. Pastafarian
  5. Henderson
  6. fsm-as-promised
  7. state-machine
  8. mood
  9. FSM Workbench
  10. SimpleStateMachine
  11. shime/micro-machine
    1. soveran/micromachine (ruby)
  12. fabiospampinato/FSM
  13. HQarroum/FSM
  14. Finite-State-Automata
  15. finite-state-machine
  16. nfm

And some similar stuff:

  1. redux-machine
  2. ember-fsm
  3. State machine cat
  4. Workty 😮
  5. sam-simpler
  6. event_chain
  7. DRAKON
  8. Yakindu Statechart Tools
  9. GraphViz
    1. Viz.js, which we use

Keywords

FAQs

Package last updated on 19 May 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc