BetaJS-Scoped is a small module for scoped loading of modules and dependencies.
JavaScript HTML
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
dist
docsrc
src
tasks
tests
.codeclimate.yml
.gitignore
.project
.travis.yml
Gruntfile.js
LICENSE
README.md
package-source.json
package.json

README.md

betajs-scoped 0.0.19

Build Status Code Climate NPM Gitter Chat

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

Resource URL
Homepage http://betajs.com
Git git://github.com/betajs/betajs-scoped.git
Repository https://github.com/betajs/betajs-scoped
Blog http://blog.betajs.com
Twitter http://twitter.com/thebetajs
Gitter https://gitter.im/betajs/betajs-scoped

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 2.2 - Latest
NodeJS 4.0 - Latest

CDN

Resource URL
scoped.js http://cdn.rawgit.com/betajs/betajs-scoped/master/dist/scoped.js
scoped.min.js http://cdn.rawgit.com/betajs/betajs-scoped/master/dist/scoped.min.js

Unit Tests

Resource URL
Test Suite Run

Weak Dependencies

Name URL
betajs-shims Open

Main Contributors

  • Oliver Friedmann

License

Apache-2.0

Sponsors

  • Ziggeo
  • Browserstack