0.2.1 • Published 8 years ago
ti-lang v0.2.1
ti-lang
tiLang is a Language which compiles into JSON and executes with Javascript!
Installation
$ npm install --save ti-lang
Usage
var tiLang = require('ti-lang');
let lang = new tiLang({
global: [{
A_GLOBAL_VARIABLE: 'node.js'
}],
methods: {
sayHi(cb) {
console.log('Hii');
return cb();
},
sayWhatISaid(text, cb) {
console.log('Yo said: ', text)
return cb();
},
multiply(multiplier1, multiplier2, cb) {
return cb(undefined, multiplier1 * multiplier2);
}
}
});
lang.execute('sayHi; set|num|15; print|${num};');
You can find more detailed usage examples in examples/tiFiles/test.ti.
License
Apache-2.0 © omeryagmurlu