ti-lang
Version:
tiLang is a Language which compiles into JSON and interpretes with Javascript!
46 lines (34 loc) • 866 B
Markdown
is a Language which compiles into JSON and executes with Javascript!
```sh
$ npm install --save ti-lang
```
```js
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.
Apache-2.0 © [omeryagmurlu](https://omeryagmurlu.github.com)
[ ]: https://badge.fury.io/js/ti-lang.svg
[ ]: https://www.npmjs.com/package/ti-lang
> tiLang