-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpackage.json
36 lines (36 loc) · 1.96 KB
/
package.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
{
"name": "portable-fsm",
"version": "1.6.0",
"description": "Simple, node/browser compatible generic FSM system",
"main": "index.js",
"repository": {
"type": "git",
"url": "https://github.com/killroy42/portable-fsm"
},
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [
"fsm",
"browser",
"node"
],
"author": {
"name": "Sven Neumann",
"email": "[email protected]",
"url": "http://svenneumann.com/"
},
"license": "MIT",
"dependencies": {},
"devDependencies": {},
"bugs": {
"url": "https://github.com/killroy42/portable-fsm/issues"
},
"homepage": "https://github.com/killroy42/portable-fsm",
"readme": "portable-fsm\r\n=============\r\n\r\nSimple, node/browser compatible generic FSM system\r\n\r\nExamples\r\n--------\r\n\r\n```javascript\r\nvar\r\n\tFSM = require('portable-fsm'),\r\n\tfsm = new FSM();\r\n\r\nfsm.debug = true;\r\n\r\nfsm.addState('start', {\r\n\tinit: 'inProgress'\r\n});\r\nfsm.addState('inProgress', {\r\n\tabort: 'cancelled',\r\n\tcomplete: 'done'\r\n});\r\n\r\nfsm.on('inProgress',\r\n\tfunction() {\r\n\t\tconsole.log('Progress start');\r\n\t\tif(Math.random() > 0.5) {\r\n\t\t\tconsole.log(' -> Aborting...');\r\n\t\t\tfsm.consume('abort');\r\n\t\t} else {\r\n\t\t\tconsole.log(' -> Completing...');\r\n\t\t\tfsm.consume('complete');\r\n\t\t}\r\n\t},\r\n\tfunction() {\r\n\t\tconsole.log('Progress end');\r\n\t}\r\n);\r\nfsm.on('cancelled', function() {\r\n\tconsole.log('Operation cancelled');\r\n});\r\nfsm.on('done', function() {\r\n\tconsole.log('Operation completed');\r\n});\r\nfsm.when('complete', function() { console.log('ALL DONE!');});\r\nfsm.when('abort', function() { console.log('ABORT! ABORT! ABORT!');});\r\n\r\nfsm.consume('init');\r\n```",
"readmeFilename": "README.md",
"gitHead": "90b70b068a9a485ed1f0d970970f6d12a94352bc",
"_id": "[email protected]",
"_shasum": "924c9cdcf92051aa5dade6568b782de4a4a35f9e",
"_from": "portable-fsm@^1.4.0"
}