Skip to content
/ comeon Public
forked from avgaltsev/comeon

CommonJS browser module loader experiment.

License

Notifications You must be signed in to change notification settings

Aetet/comeon

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 

Repository files navigation

Comeon

Experimental CommonJS module loader for browsers.

Usage

Link comeon.js to the page with data-path and data-main attributes that define where your modules are placed and which of them is the main respectively:

<script src="http://rawgithub.com/avgaltsev/comeon/master/comeon.js" data-path="scripts/" data-main="main"></script>

Or do it without magic:

<script src="http://rawgithub.com/avgaltsev/comeon/master/comeon.js"></script>

<script>
	
	window.onload = function () {
		
		// Each instance of Comeon has its own path configuration and module cache
		var comeon = new Comeon("scripts/");
		
		// Entry point
		comeon.require("main");
		
		// Another entry point with callback function
		comeon.require("another_main", function (exports) {
			console.log(exports);
		});
		
	};
	
</script>

About

CommonJS browser module loader experiment.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published