borrower

0.4.0 • Public • Published

Borrower

Gitter Build Status Dependency Status

Forget complexity of Require.js config, don't worry about running Bower install.

Note: this project is a work in progress.

The goal is to keep a single configuration file and a working enviromnemnt with a single install command.

Usage

$ npm install borrower --save
 
$ node_modules/.bin/borrower install jquery --save

It will install Bower Components in static_modules/ and save dependency in package.json.

html

<script data-main="app.js" src="static_modules/require.js"></script>

Require.js is configured, you can just focus on your Javascript.

That's all folks !

Configuration

package.json

{
    ...
    staticDependencies: [...],
    ...
    config: {
        bower: {
            directory: 'static_modules',  // name of the folfder containing dependencies
            cwd: '',                      // where static modules must be installed
            baseUrl: ''                   // location of the ducoment root
                                          // an absolute path from this location will be used in requirejs config
                                          // if empty, a relative path will be used
        }
    }
}

Configurations from .bowerrc are available in package.json > config > bower

express static example: ...

How it works

$ borrower init

It will register a npm postinstall hook in your package.json to run Bower and configure Require on every npm install.

Require.js is configured inside static_modules/require.js and updated at each install run.

Readme

Keywords

none

Package Sidebar

Install

npm i borrower

Weekly Downloads

9

Version

0.4.0

License

MIT

Last publish

Collaborators

  • jsan