betajs-scoped 0.0.22

BetaJS-Scoped is a small module for scoped loading of modules and dependencies.
Getting Started
You can use the library in the browser, in your NodeJS project and compile it as well.
Browser
<script src="betajs-scoped/dist/scoped.min.js"></script>
NodeJS
var Scoped = require('betajs-scoped/dist/scoped.js');
Compile
git clone https://github.com/betajs/betajs-scoped.git
npm install
grunt
Basic Usage
(function () {
var Scoped = this.subScope();
Scoped.binding("module", "global:MyLibrary");
Scoped.binding("dependency1", "global:ExternalDependency1");
Scoped.binding("dependency2", "global:ExternalDependency2");
// Library code
}).call(Scoped);
Scoped.require(['ns1:dependency1', 'ns2:dependency2', 'ns3:dependency3'], function (D1, D2, D3) {
// Execute once D1, D2, D3 are resolved.
});
Scoped.define('ns:module', ['ns1:dependency1', 'ns2:dependency2', 'ns3:dependency3'], function (D1, D2, D3) {
// Execute once D1, D2, D3 are resolved.
return {
// Return ns:module definition.
};
});
Scoped.extend('ns:module', ['ns1:dependency1', 'ns2:dependency2', 'ns3:dependency3'], function (D1, D2, D3) {
// Execute once D1, D2, D3 are resolved.
return {
// Return ns:module extension.
};
});
Links
Compatability
Target |
Versions |
Firefox |
3 - Latest |
Chrome |
18 - Latest |
Safari |
4 - Latest |
Opera |
12 - Latest |
Internet Explorer |
6 - Latest |
Edge |
12 - Latest |
Yandex |
Latest |
iOS |
3.0 - Latest |
Android |
4.4 - Latest |
NodeJS |
4.0 - Latest |
CDN
Unit Tests
Resource |
URL |
Test Suite |
Run |
Weak Dependencies
Name |
URL |
betajs-shims |
Open |
Main Contributors
License
Apache-2.0
Sponsors