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:
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");
}).call(Scoped);
Scoped.require(['ns1:dependency1', 'ns2:dependency2', 'ns3:dependency3'], function (D1, D2, D3) {
});
Scoped.define('ns:module', ['ns1:dependency1', 'ns2:dependency2', 'ns3:dependency3'], function (D1, D2, D3) {
return {
};
});
Scoped.extend('ns:module', ['ns1:dependency1', 'ns2:dependency2', 'ns3:dependency3'], function (D1, D2, D3) {
return {
};
});
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
Weak Dependencies
Main Contributors
License
Apache-2.0