bower-to-locals

adds all bower mainfiles to res.locals


Keywords
bower, include, jade
License
MIT
Install
npm install bower-to-locals@0.1.4

Documentation

bowerToLocals

A simple middleware to select all Bower main files and saves them into the response.locals Object.

Install

npm install bower-to-locals

How to use

var express = require('express');
var app = express();

require('bower-to-locals').init(app);

To see all the current seleced files:

var express = require('express');
var app = express();
var bowerToLocals = require('bower-to-locals');
bowerToLocals.init(app);
 
if(app.env === 'development'){
  console.log(bowerToLocals.list());
}
 ---- start section bower-to-locals ----
bootstrap.less
bootstrap.css
bootstrap.js
bootstrap.eot
bootstrap.svg
bootstrap.ttf
bootstrap.woff
jquery
---- end section ----

In a jade file for example:

script(src=jquery)
script(src=bootstrap.js)

Minify

Js

To minify js just call minify after init

var express = require('express');
var app = express();
var bowerToLocals = require('bower-to-locals');
bowerToLocals.init(app);
bowerToLocals.minify();