Skip to content

A simple sugar syntax to create modules in Vanilla JavaScript

Notifications You must be signed in to change notification settings

jonasaraldi/module.js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 

Repository files navigation

module.js

Configuration

Defining a constructor method name for the module

Module.config({
	constructor: "initialize" // optional, default: init
});

Usage: Creating a module

Method signarute

Module(namespace, moduleScope, dependencies)

Examples

Creating a simple module attached with the namescape App.MyModule and with 2 dependencies (window and document object).

Module("App.MyModule", 
	function(global, doc) {
		"use strict"

		return {
			init: init
		}

		function init() {
			console.log("init");
		}
	},
	[window, document]
);

About

A simple sugar syntax to create modules in Vanilla JavaScript

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published