ribbit

Javascript Tasks

Javascript Tasks

var capirona = require("capirona");
 
capirona.make({
    "def hello/:name": {
        "run"function(targetnext) {
            console.log("hello %s!", target.data.name);
            next(); 
        }
    }
}).run("hello/craig", function() {
    console.log("done");
});

creates a new runnable script

runs the given task. The target can be any value. For example:

 
capirona.make({
        "def log": {
                "run"function(targetnext) {
                        console.log(target.value || target.data.text);
                        next();
                }
        }
}).
run("log", "hello world!").
run("log", {
    text: "hello world!"
});