bower-amd-paths
v1.0.2-0
Published
Populates "paths" for AMD (RequireJS) config with installed Bower components
Downloads
14
Readme
bower-amd-paths
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