(<2kb) A lite module loader and cache module in localStorage.
$ npm install --save-dev micro-definition
Define( id : String, method : Function )
Define('mod', function () {
// some code;
return value;
});
Define( id : String, dependency : Array, method : Function )
Define('mod-a', ['mod-b', 'mod-c'], function ( b, c ) {
// some code;
return value;
});
Define( dependency : Array, callback : Function )
Define(['jQuery', 'lodash'], function ( $, _ ) {
// some code;
});
Define.alias( alias : Object )
Define.alias({
'mod-a' : 'a.js',
'mod-b' : 'b.js',
});
More Define.storage
api see micro-storage.
Define.storage.list();
More Define.storage
api see micro-storage.
Define.storage.remove('mod-a');
MIT