bower-to-locals

0.1.4 • Public • Published

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();

Readme

Keywords

Package Sidebar

Install

npm i bower-to-locals

Weekly Downloads

1

Version

0.1.4

License

none

Last publish

Collaborators

  • starman