Skip to content
This repository has been archived by the owner on Dec 10, 2020. It is now read-only.

towry-archived/blendjs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Blend.js

A lightweight asynchronous module definition(AMD) library

Usage

// module `a` depend on `b`
define('a', ['b'], function (b) {
	b();
})

// module `b` depend on `c` and `d`
define('b', ['c', 'd'], function (c, d) {
	return function () {
		console.log(c + d);
	}
})

// module `c` depend on nothing
define('c', function () {
	return 2;
})

// module `d` depend on nothing
define('d', function (e) {
	e(3);
})

The output is

5

Note: you can define the modules in any order.

Install

You can install it via package manager

bower: bower install blendjs

npm: npm install blendjs

License

MIT license (http://towry.me/mit-license)


Copyright 2015 by Towry Wang