best asset manager one can get in nodejs
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.


best asset manager one can get in nodejs (at least we hope so)

Why does voila exist?

We needed an asset manager which meets the following condition:

  • Optimized for runtime such that major processing occurs before deployment, not during app launch.
  • Support CDNs wth the node.js server as origin for assets with md5 extended asset names.
  • Process all major engines like coffee, stylus, less, ejs etc..
  • Provide a helper for asset path which doesn't suck

Under the hood we use mincer which did the heavy lifting.

Voila is the brainchild of Pavan Kumar Sunkara


Go to you app root directory and run

npm install --save voila


In your connect/express application

var express = require('express')
  , voila = require('voila')
  , app = expres();

var conf = {
  development: {},
  production: {
    serve: ""

app.use('/assets', voila(__dirname + '/../', conf[process.env.NODE_ENV])

That pretty much sets up the pipeline. Defaul directory structure is as follows

├─┬ assets
│ ├── css
│ ├── js
│ └── img
└─┬ public
  └── assets
  • app/assets should be ignored in .npmignore (which is generally used for nodejs deployment)
  • app/public/assets should be ignored in .gitignore (which is used for committing to repo)

In your package json add the following:

"scripts": {
  "assets": "rm -rf public/assets/* && voila -p"

This script should be activated before you publish to production, npm run-script assets. It creates the preprocessed files in /public/assets



Bug Reports

Report here.