hi!
I am writing a templating engine where I generate JavaScript code from a mustache like template.
The templates use asynchronous ways of getting data, partials and stuff like this. So far everything works as expected.
I am now searching for a way to include structures like if / else, for and so on. I think that streamline.js can help me with this. What I haven't found is a way to compile a string in node.js.
For example I have the following code:
var code = "console.log('hello ...');";
code += "setTimeout(_, 1000);";
code += "console.log('... world');"
Now I would expected something like:
var streamlined = require("streamline").compile(code);
to execute the code:
streamlined();
Is it possible to use streamline in this way?
Regards,
Michael