web-module
v1.0.4
Published
Inlementation of module pattern for loading the content dynamically on web site.
Downloads
21
Maintainers
Readme
web-module
Inlementation of module pattern for loading the content dynamically on web site.
Usage
Include
<script src="node_modules/web-module/web-module.js"></script>
Define module
module.define('module-name', (function(){
// Return something
})());
Get module
const func = module.require('module-name');
// Do something with func
Built-in modules
load
Load html, javascript, css content dynamically.
Example:
const load = module.require('load');
load('html-url')
.then((html)=>{
// Do something with html
})
.load('script-url')
.then(()=>{
// Do something after loading script
})
.load('style.css');
Bugs or feature requests
Please contact to email