melchior.js

Introducing the most javascripty way to configure dependencies.
The first module loader with Chainable Module Definition API.
Examples ❒ Docs

Simple.

Get rid of long lines of AMD declaring and writing module names twice!
Create module, chain requires and you are ready to use them inside.
// create module
melchiorjs.module('yourModule')

// define dependencies
.require('dependencyUno')
.require('dependencyDuo', 'duo')

// define module body
.body(function () {
    // `dependencyUno` is available here!
    dependencyUno.doSomething();

    // aliased `dependencyDuo` is available as `duo`!
    duo.doSomething();

    // return methods for other modules
    return {
        method: function () { ... },
        anotherMethod: function () { ... }
    };
});

Configurable.

Melchior's script loader asynchronously resolves dependencies.
Non-melchior modules and frameworks are handled automatically.
melchiorjs.config({
    paths: {
        'jQuery': 'path/to/jquery',
        'underscore': 'path/to/underscore',
        'myModule': 'path/to/myModule'
    },

    // provide shim to non-melchior modules if needed
    // declare globals returned by libraries and deps
    shim: {
        underscore: {
            exports: '_'
        }
    }
});
Just put config into "data-main" entry point for all of your modules.
<script src="path/melchior.js" data-main="path/entry.js">

Small.

Melchior is just 3KB when minified and supports all major browsers.
Including Internet Explorer 8+, Chrome 1+, Firefox 2+, Opera 10+,
Safari 3+ and popular mobile browsers.
Fork on Github