GitXplorerGitXplorer
s

anabolic-js

public
2 stars
0 forks
0 issues

Commits

List of commits on branch develop.
Unverified
db346eee2e4cce1b3b2aa4922d6c20811bd9bc70

updated to work with latest jasmine api

ssadams committed 10 years ago
Unverified
38f039715eaf28fc33d64219c7f61e9c7f1d000f

added dep validation and allows non-functions

ssadams committed 11 years ago
Unverified
7d96ed184478cab663e1274694449d823d5c41b2

Merge branch 'master' into develop

ssadams committed 11 years ago
Unverified
6328512b13692b41fddd8d68836f23ea003532cc

Added tests and grunt to build.

ssadams committed 11 years ago
Unverified
24455f5e0a4cc2635101a2746f7b63e786b81ba0

Update README.md

ssadams committed 11 years ago
Unverified
12f649359fe9bd3bfa62912d06603d6b0712bc4e

Initial commit

ssadams committed 11 years ago

README

The README file for this repository.

anabolic-js

Very, VERY lightweight JS dependency injection library (loosely based on AMD).

Installing

Include build/anabolic.min.js in your project; it declares both 'require' and 'define' methods in whichever scope the code is included (if including via html script tags, these will be global).

Usage

You define dependencies to be required in your code.

Dependencies are only resolved when required.

Your best bet is you look at the tests, but here is an example:

define('bar', function() {
    return 'abc';
});
define('another', function() {
    return {
        a:'b',
        c:'d'
    };
});
define('baz', ['bar'], function(bar) {
    return bar + 'def';
});
require(['baz', 'another'], function(baz, another){
    console.log(baz, another);
});

Testing

npm install -g grunt-cli && npm install

Then

grunt

This builds a minified version in 'build' directory and runs jasmine tests.