Quick Start
Clone or fork the full tree
If you would like to start experimenting with ignite.js, then the easiest way to play with our example applications is to clone our git repository. This gives you access to the source, examples, tests etc.
The full source of ignite.js is available on GitHub, here:
You can therefore clone our tree, and set up the dependencies with:
$ git clone https://github.com/ignitejs/ignite.git $ cd ignite $ npm install # This might take a while $ export NODE_PATH=$NODE_PATH:`pwd` # So the examples can find the 'ignite' module
There are a number of examples to demonstrate how ignite.js can be used. These use a helper application (called ignite) to run an instance of the example state machine (but note that it's just a helper, underneath everything is just pure node JavaScript).
$ ./bin/ignite examples/hello_world.js Running examples/hello_world.js hello world run: examples/hello_world.js Exited with no error. $ $ ./bin/ignite examples/rss_feed.js Running examples/rss_feed.js 12:10:06: Second NATO helicopter crashes; Afghans protest over killings 12:06:58: Washington convinces Saleh not to return to Yemen: report 12:00:44: Stocks hit by U.S. unease as ECB supports Italy, Spain 11:46:49: Syrian tanks pound city, Saudi king condemns violence 10:55:44: Britain, other eurozone countries face ratings cut - Jim Rogers 10:54:15: Wall Street braces for impact from U.S. downgrade 09:14:03: ECB backs Italy, Spain as policymakers pledge action 08:34:04: Police arrest 100 after riots in London 08:31:49: Euro zone must ensure financial stability - Osborne
You can ask to see a lot of logging information to be printed out by ignite by adding a -L option - changing the value alters the amount of detail printed (0=none, 8=full):
$ ./bin/ignite -L 8 examples/hello_world.js Running examples/hello_world.js IGNT:helloWorld:0001:EVNT: [start] IGNT:helloWorld:0001:CALL: [@enter/action/start] IGNT:helloWorld:0001:CALL: [@enter/exit/1] IGNT:helloWorld:0001:CALL: [@enter/exit/0] IGNT:helloWorld:0001:ENTR IGNT:helloWorld:0001:CHNG: [@enter] -> [HelloWorld] IGNT:helloWorld:0001:CALL: [HelloWorld/entry/0] hello world IGNT:helloWorld:0001:CHNG: [HelloWorld] -> [@exit] IGNT:helloWorld:0001:CALL: [@exit/entry/0] IGNT:helloWorld:0001:EXIT run: examples/hello_world.js Exited with no error. $
The test suite can be run with:
$ ./bin/runTests
If you get bored of typing ./bin/ignite then you can add the ignite bin directory to your shell's search path with:
$ export PATH=$PATH:`pwd`/bin
NPM Module
ignite.js is also available as an NPM module - which allows you to easily use it within your own apps. To install within the local node_modules:
$ npm install ignite
Or, to install globally
$ npm install ignite -g