{
  "name": "connect-assets",
  "version": "2.5.2",
  "author": {
    "name": "Andrew Dunkman",
    "email": "andrew@dunkman.org"
  },
  "description": "A Rails-like asset pipeline for Connect",
  "contributors": [
    {
      "name": "Trevor Burnham",
      "email": "trevorburnham@gmail.com",
      "url": "http://trevorburnham.com/"
    },
    {
      "name": "Andrew Dunkman",
      "email": "andrew@dunkman.org"
    },
    {
      "name": "Dusty Burwell",
      "email": "dustyburwell@gmail.com"
    },
    {
      "name": "Blake VanLandingham",
      "email": "blakevanlan@gmail.com"
    }
  ],
  "repository": {
    "type": "git",
    "url": "https://github.com/adunkman/connect-assets.git"
  },
  "engines": {
    "node": ">=0.8.0"
  },
  "main": "lib/assets.js",
  "dependencies": {
    "connect-file-cache": "0.2.5",
    "snockets": "1.3.8"
  },
  "devDependencies": {
    "async": "0.1.14",
    "coffee-script": "~1.3.1",
    "connect": "1.8.5",
    "nib": "0.2.0",
    "bootstrap-stylus": "0.2.0",
    "nodeunit": "0.7.4",
    "stylus": "0.22.2",
    "request": "2.1.1",
    "watchit": "0.0.4",
    "less": "1.4.0",
    "docco": "~0.4.0"
  },
  "scripts": {
    "test": "cake test"
  },
  "readme": "# connect-assets\n\n[![Build Status](https://travis-ci.org/adunkman/connect-assets.png?branch=master)](https://travis-ci.org/adunkman/connect-assets)\n\nTransparent file compilation and dependency management for Node's [connect](https://github.com/senchalabs/connect) framework in the spirit of the Rails 3.1 asset pipeline.\n\n## The state of the package\n\nAs of February 21, 2013, @adunkman became the maintainer of this package. The game plan is as follows:\n- Address critical issues with version 2.x (master branch) to take care of the open pull requests/issues.\n- Begin a version 3.x (v3 branch) that introduces stronger tests and code structure to make contributing easier to manage, reducing dependencies as possible.\n\n## Plans for version 3.0\n\n* Rewrite in JS\n* Cleaner code\n    * Shorter files\n    * Better defined responsibilities\n* No singleton\n* Replace connect-file-cache\n* Look for replacment for Snockets\n* Remove dependence on underscore\n* Remove dependence on mime\n* Write tests in mocha\n* Remove Cakefile\n\n## What?\n\nconnect-assets can:\n\n1. Serve `.coffee` ([CoffeeScript](http://coffeescript.org)) files as compiled `.js`\n1. Concatenate `.coffee` and `.js` together using [Snockets](https://github.com/TrevorBurnham/snockets)\n1. Serve `.styl` ([Stylus](http://learnboost.github.com/stylus/)) as compiled `.css` with\n    -  [nib](https://github.com/visionmedia/nib)\n    -  [Twitter Bootstrap](https://github.com/shomeya/bootstrap-stylus)\n1. Serve `.less` ([Less](http://lesscss.org/)) as compiled `.css` with\n    - [Twitter Bootstrap](https://github.com/twitter/bootstrap)\n1. Serve files with an MD5 hash suffix and use a far-future expires header for maximum efficiency\n1. Avoid redundant git diffs by storing compiled `.js` and `.css` files in memory rather than writing them to the disk—except when you want them (e.g. for deployment to a CDN).\n\n## How?\n\nFirst, install it in your project's directory:\n\n    npm install connect-assets\n\nAlso install any specific compilers you'll need, e.g.:\n\n    npm install coffee-script\n    npm install stylus\n    npm install nib\n    npm install bootstrap-stylus\n    npm install less\n\nThen add this line to your app's configuration:\n\n    app.use require('connect-assets')()\n\nFinally, create an `assets` directory in your project and throw all your `.coffee` files in /assets/js and `.styl`, `.less` files in /assets/css.\n\n### Markup functions\n\nconnect-assets provides two global functions named `js` and `css`. Use them in your views. They tell connect-assets to do any necessary compilation, then return the markup you need. For instance, in a [Jade template](http://jade-lang.com/), the code\n\n    != css('normalize')\n    != js('jquery')\n\n(where `!= is Jade's syntax for running JS and displaying its output) results in the markup\n\n    <link rel=\"stylesheet\" href=\"/css/normalize.css\" />\n    <script src=\"/js/jquery.js\"></script>\n\n### Sprockets-style concatenation\n\nYou can indicate dependencies in your CoffeeScript files using the Sprockets-style syntax\n\n    #= require dependency\n\n(or `//= require dependency` in JavaScript). When you do so, and point the `js` function at that file, two things can happen:\n\n1. By default, you'll get multiple `<script>` tags out, in an order that gives you all of your dependencies.\n2. If you passed the `build: true` option to connect-assets (enabled by default when `process.env.NODE_ENV == 'production'`), you'll just get a single tag, wich will point to a JavaScript file that encompasses the target's entire dependency graph—compiled, concatenated, and minified (with [UglifyJS](https://github.com/mishoo/UglifyJS)).\n\nIf you want to bring in a whole folder of scripts, use\n\n    #= require_tree dir\n\nSee [Snockets](http://github.com/TrevorBurnham/snockets) for more information.\n\n**Note:** CSS concatenation is not supported by connect-assets directly, because Stylus and Less already do a fine job of this. Stylus and Less are basically supersets of CSS, so just rename your `.css` files to `.styl` or `.less` and learn about the @import ([Stylus](http://learnboost.github.com/stylus/docs/import.html), [Less](http://lesscss.org/#-importing)) syntax.\n\n## Options\n\nIf you like, you can pass any of these options to the function returned by `require('connect-assets')`:\n\n* `src` (defaults to `'assets'`): The directory assets will be read from\n* `helperContext` (defaults to `global`): The object the `css` and `js` helper functions will attach to\n* `buildDir` (defaults to `builtAssets`): Writes built asset files to disk using this directory in `production` environment, set to `false` to disable\n* ... see the source (`src/assets.coffee`) for more.\n\nYou can also set the \"root path\" on the `css` and `js` helper functions (by default, `/css` and `/js`), e.g.\n\n    css.root = '/stylesheets'\n    js.root  = '/javascripts'\n\nTo override these roots, start a path with `'/'`. So, for instance,\n\n    css('style.css')\n\ngenerates\n\n    <link rel='stylesheet' href='/css/style.css'>\n\nwhile\n\n    css('/style.css')\n\ngives you\n\n    <link rel='stylesheet' href='/style.css'>\n\n## Generated documentation \n\nThere is generated documentation (created with [docco](http://jashkenas.github.com/docco/)) available [here](http://adunkman.github.com/connect-assets/).\n\n## Credits\n\nBorrows heavily from Connect's [compiler](https://github.com/senchalabs/connect/blob/1.6.4/lib/middleware/compiler.js) and [static](https://github.com/senchalabs/connect/blob/1.6.4/lib/middleware/static.js) middlewares, and of course sstephenson's [Sprockets](https://github.com/sstephenson/sprockets).\n\nLook at these [awesome people](https://github.com/adunkman/connect-assets/contributors) who make this project possible.",
  "readmeFilename": "README.md",
  "bugs": {
    "url": "https://github.com/adunkman/connect-assets/issues"
  },
  "_id": "connect-assets@2.5.2",
  "_from": "connect-assets@latest"
}
