morgas
v0.8.8
Published
dependency free framework for fun
Downloads
4
Readme
Morgas.js
JavaScript data processing framework for fun
Usage
- Browser
<script defer src="Morgas.js"></script>
- Node
- cli
npm install morgas
- js
require("morgas"); // creates global "Morgas" and "µ" namespaces
µ.getModule("<name>")
. - cli
##Node custom modules In order to load custom modules you need to
µ.addModuleRegister(register,baseDir);
// or
µ.addResourceFolder(folder);
In resource folders the filename is automatically also the module name.
##Build npm build script for bundles
npm run build <bundleName.js> <module> [module [...]]
output
build/bundleName.js
build/bundleName.js.map
You can also write your own script with require("Morgas/lib/dependencyParser")
and µ.getModule("DependencyResolver")
.
##dependencyParser checks for
SC=SC({
[...]
});
and parses every shortcut as "use" dependency and every GMOD("<moduleName>")
before that as "hard" dependency.
therefore it is recommended to use an IIFE like this:
(function(µ,SMOD,GMOD,HMOD,SC){
})(Morgas,Morgas.setModule,Morgas.getModule,Morgas.hasModule,Morgas.shortcut);