dependant

0.0.3 • Public • Published

Dependant

Dependant is a dependency manager for frontend JavaScript. Unlike AMD, there's no enforced format. If a library can be used with <script> tags, it works with Dependant.

Install

[sudo] npm install -g dependant

Configure

Create a file deps.json in your project root that looks something like this:

{
    "vendor": { // Third party code in here
        "base": "res", // Optional, defaults to "js"
        "packages": {
            "jquery": {},
            "underscore": {},
            "backbone" : {
                "deps": ["jquery", "underscore"] // Optional, defaults to []
            },
            "ace": {
                "path": "ace/src/ace.js" // Optional, defaults to base/name.js
            }
        }
    },
    "app": { // Your code in here
        "packages": {
            "modal": {},
            "settings": {
                "deps": ["modal"]
            },
            "toolbar": {},
            "main": {
                "deps": ["settings"]
            }
        }
    }
}

Use

Run dep > all.js from the project root. Dependant will work out what order the files need to be in, then concatenate all the files in that order into all.js. Then stick <script src="all.js"></script> into your HTML.

Readme

Keywords

none

Package Sidebar

Install

npm i dependant

Weekly Downloads

3

Version

0.0.3

License

MIT

Last publish

Collaborators

  • lavelle