jsm-compiler
v0.3.1
Published
Javascript Modular Compiler
Downloads
5
Readme
JavaScript Module Compiler
This tool lets you create basic javascript only applications. Additionaly you will be able to use namespaces and templates rather easy. At the end on every save you get a full build of your latest changes. Production-Ready. Example:
// Set your template
template "start.html" as start;
// You start with a namespace
namespace test.a.b.c;
// And then you define a class
Test = function() {
// set the template content to the body
document.body.innerHTML = start;
}
Test.prototype.hallo = function() {
}
Then automaticly your namespace will generated and the created classes will get the right namespace aswell.
Output:
if(typeof test.a=="undefined")test.a={};
if(typeof test.a.b=="undefined")test.a.b={};
if(typeof test.a.b.c=="undefined")test.a.b.c={};
start=document.getElementById("templates/start.html").innerHTML;
test.a.b.c.Test=function(){document.body.innerHTML = start;}
test.a.b.c.Test.prototype.hallo=function(){}
test.a.b.c.Help=function(){}
Install via npm
npm install -g jsm-compiler
Usage:
You have to be in a jsm project:
jsmc build