bower-amd-paths

    1.0.2-0 • Public • Published

    bower-amd-paths Build Status

    Populates "paths" for AMD (RequireJS) config with installed Bower components

    Install

    $ npm install --save bower-amd-paths

    Usage

    var bowerAmdPaths = require('bower-amd-paths');

    if you have the following in your .bowerrc

    {
      "cwd": "webapp",
      "directory": "vendor"
    }

    this will return something similar to this:

       { jquery: 'webapp/vendor/jquery/dist/jquery',
         handlebars: 'webapp/vendor/handlebars/handlebars',
         bootstrap: 'webapp/vendor/bootstrap/dist/js/bootstrap',
         almond: 'webapp/vendor/almond/almond',
         'lodash.compat': 'webapp/vendor/lodash/dist/lodash.compat',
         backbone: 'webapp/vendor/backbone-amd/backbone' }
       }

    API

    var bowerAmdPaths = require('bower-amd-paths')

    bowerAmdPaths([options], callback)

    options.cwd

    Type: String

    This should be base Bower directory, or directory where .bowerrc is located

    bowerAmdPaths({cwd: './application'}, function(err, result){
        ...
    });

    callback

    Type: Function

    bowerAmdPaths(function(err, result){
        ...
    });

    err - error or null

    results - array with paths

    Install

    npm i bower-amd-paths

    DownloadsWeekly Downloads

    1

    Version

    1.0.2-0

    License

    MIT

    Last publish

    Collaborators

    • gkoychev