web-module

1.0.4 • Public • Published

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

License

ISC

Package Sidebar

Install

npm i web-module

Weekly Downloads

1

Version

1.0.4

License

ISC

Last publish

Collaborators

  • lchild358