2.2.2 • Published 5 years ago

fsm2dot v2.2.2

Weekly downloads
4
License
MIT
Repository
github
Last release
5 years ago

fsm2dot

Inspects a file containing a finite state machine defined using fsm-as-promised or javascript-state-machine libraries, and outputs the correspondent UML diagram using DOT graph representation.

NPM Version NPM License Build Status Coverage Status

Features

The following finite state machine:

/*
 * the file must contain
 * var StateMachine = require('fsm-as-promised');
 * or
 * var StateMachine = require('javascript-state-machine');
 */

var fsm = StateMachine.create({
  initial: 'start',
  final: 'stop',
  events: [
    { name: 'init', from: 'start', to: 'Ready' },
    { name: 'proceed', from: 'Ready', to: 'Steady' },
    { name: 'end', from: 'Steady', to: 'stop' },

    { name: 'test', from: 'Ready', to: 'Ready' }
  ],
  callbacks: {
    onReady: function () {},
    onleaveReady: function LeaveReady() {},
    onSteady: onS,
    ontest: function Activity() {}
  }
});

function onS() {}

will be converted to a DOT graph that can be visialized like this:

Image

Command Line

Install node, then:

$ npm install -g fsm2dot

and run:

$ fsm2dot --help

Test

$ npm install -g mocha
$ npm test

License

MIT

2.2.2

5 years ago

2.2.1

5 years ago

2.2.0

6 years ago

2.1.0

6 years ago

2.0.1

6 years ago

2.0.0

6 years ago

1.3.0

6 years ago

1.2.0

6 years ago

1.0.0

8 years ago

0.2.0

8 years ago

0.1.4

10 years ago

0.1.3

10 years ago

0.1.1

10 years ago

0.1.0

10 years ago