Search code examples
javascriptjquerynode.jsmachina.js

How to include machina.js into a node.js application


I want to start learning how to use Machina.js but I simply can not get it to work. According to the documentation I should be able to include Machina with

var lodash = require('lodash');
var machina = require('machina')(lodash);

but I get the following error.

var machina = require('machina')(lodash);
                                 ^
TypeError: object is not a function

I noticed that I should also be able to use

var machina = require('machina')();

and underscore will be used instead of lodash, but I get the same error


Solution

  • If you use current version (1.1.1), just

    var machina = require('machina');
    

    then you can start use it: http://code.dougneiner.com/presentations/machina/#session/1/slide/17