0.1.4 • Published 11 years ago
bower-to-locals v0.1.4
bowerToLocals
A simple middleware to select all Bower main files and saves them into the response.locals Object.
Install
npm install bower-to-localsHow 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();