{"_id":"asset-rack","_rev":"111-4d14de420a49d779464c4346b42dd622","name":"asset-rack","description":"Static Web Framework for Nodejs","dist-tags":{"latest":"2.2.2"},"versions":{"1.0.1":{"name":"asset-rack","version":"1.0.1","description":"Asset managemnt framework for nodejs","author":{"name":"Brad Carleton","email":"brad@techpines.com"},"repository":{"type":"git","url":"git://github.com/techpines/asset-rack.git"},"dependencies":{"coffee-script":"1.3.1","browserify":"1.13.5","uglify-js":"1.3.0","async":"0.1.22","knox":"0.0.9","less":"1.3.0","mime":"1.2.6"},"main":"switch.js","engines":{"node":">= 0.5.0"},"_npmUser":{"name":"brad@techpines.com","email":"brad@techpines.com"},"_id":"asset-rack@1.0.1","devDependencies":{},"_engineSupported":true,"_npmVersion":"1.0.106","_nodeVersion":"v0.6.15","_defaultsLoaded":true,"dist":{"shasum":"b4d7722fed41af356b8565b7406630310aa868ac","tarball":"https://registry.npmjs.org/asset-rack/-/asset-rack-1.0.1.tgz","integrity":"sha512-f5kocVGlq1vgCcSYIHRTk6UFvZzGvfMw6RDL7okIWVjoffQPY7K1TJ9mMdiYKjJPVArrXm6hLgiK/5C/mqIlcg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDyib83qpNTM9znJ+juRXdOXt0EZPSARXO5O+cP+bo1lAiEAzs0oM/eDFuP0wkZvSET0reADFH/6aKk2T/0U3EmrzPo="}]},"maintainers":[{"name":"brad@techpines.com","email":"brad@techpines.com"}],"directories":{}},"1.1.0":{"name":"asset-rack","version":"1.1.0","description":"Asset management framework for nodejs","author":{"name":"Brad Carleton","email":"brad@techpines.com"},"repository":{"type":"git","url":"git://github.com/techpines/asset-rack.git"},"dependencies":{"coffee-script":"1.3.1","browserify":"1.13.5","uglify-js":"1.3.0","async":"0.1.22","knox":"0.0.9","less":"1.3.0","mime":"1.2.6"},"main":"switch.js","engines":{"node":">= 0.5.0"},"_npmUser":{"name":"brad@techpines.com","email":"brad@techpines.com"},"_id":"asset-rack@1.1.0","devDependencies":{},"_engineSupported":true,"_npmVersion":"1.0.106","_nodeVersion":"v0.6.15","_defaultsLoaded":true,"dist":{"shasum":"15ebeae22d57b60082fafbc8952aa27dcdfc5cdc","tarball":"https://registry.npmjs.org/asset-rack/-/asset-rack-1.1.0.tgz","integrity":"sha512-fY2adNXsHyzpPdhhQnKFgAxj4uJG6xEEP1ik74yDcAHZRs7PEtCxbDT+ITtMWcG0Jn+5TF9rr13SQg2zYzcyYA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDxtfHxqTBbfIW9JQHyPtYPBOB9g8mVdOZJK9Uugp6I6AIhAM8c4PKHAc8NYrrNSm9KB89X7Ssmqa+0c5p0yGRoGNLK"}]},"maintainers":[{"name":"brad@techpines.com","email":"brad@techpines.com"}],"directories":{}},"1.1.1":{"name":"asset-rack","version":"1.1.1","description":"Asset management framework for nodejs","author":{"name":"Brad Carleton","email":"brad@techpines.com"},"repository":{"type":"git","url":"git://github.com/techpines/asset-rack.git"},"dependencies":{"coffee-script":"1.3.1","browserify":"1.13.5","uglify-js":"1.3.0","async":"0.1.22","knox":"0.0.9","less":"1.3.0","mime":"1.2.6"},"main":"switch.js","engines":{"node":">= 0.5.0"},"_npmUser":{"name":"brad@techpines.com","email":"brad@techpines.com"},"_id":"asset-rack@1.1.1","devDependencies":{},"_engineSupported":true,"_npmVersion":"1.0.106","_nodeVersion":"v0.6.15","_defaultsLoaded":true,"dist":{"shasum":"4a3836abeeeace1e16379ca9f0474f791c216c92","tarball":"https://registry.npmjs.org/asset-rack/-/asset-rack-1.1.1.tgz","integrity":"sha512-Tak/RWuNmofzk2/fTB8w1mGjWR5nOAUKwdBjriG4AciIRqNa8OJXGc/fcFM2HXqtEgFlEgwxYqwqjhAXCFWdWA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCJBurDeKTXx5YjquxYmAmWcHoOXzN230BTiTOIiw+G3wIhAK9M/vGTDR02bHPYZ84SNL6heMR3yqpjjzX9+U3Jzl7T"}]},"maintainers":[{"name":"brad@techpines.com","email":"brad@techpines.com"}],"directories":{}},"1.1.2":{"name":"asset-rack","version":"1.1.2","description":"Asset management framework for nodejs","author":{"name":"Brad Carleton","email":"brad@techpines.com"},"repository":{"type":"git","url":"git://github.com/techpines/asset-rack"},"dependencies":{"coffee-script":"1.3.1","browserify":"1.13.5","uglify-js":"1.3.0","async":"0.1.22","knox":"0.0.9","less":"1.3.0","mime":"1.2.6"},"main":"switch.js","engines":{"node":">= 0.5.0"},"readme":"\n![asset-rack!](http://www.techpines.com/static/logo/asset-rack.png)\n\nA node-style asset management framework. Designed for Single Page Apps.\n\nInspired by Trevor Burnham's [connect-assets](https://github.com/TrevorBurnham/connect-assets), and the Rails [Asset Pipeline](http://guides.rubyonrails.org/asset_pipeline.html)\n\n* __Orignal Author__: Brad Carleton\n* __Company__: Tech Pines\n* __Blog Intro__: [Introducing AssetRack](http://www.techpines.com/blog/asset-rack-dynamic-asset-management-nodejs)\n\n## Features\n\n1. Dynamic asset creation for js, css, html templates.\n2. Support for js/coffescript, browserify (node-style requires).\n3. Support for less.\n4. Support for jade templates.\n4. Multi-process, multi-server out of the box.  Share nothing.\n5. Filenames hashed for \"forever\" HTML caching and easy CDN updates.\n6. No need to ever compile static files to disk, all-in memory.\n7. Ability to push compiled files to Amazon S3 for use with Cloudfront.\n8. Can be plugged into express as connect middleware.\n9. Easily extensible.\n\n## Install\n\n```bash\nnpm install asset-rack\n```\n\n## Concepts\n\nThere are two very simple conepts to understand with asset-rack.\n\n### Asset\nAn asset after it is `complete`, consists of three very important things.\n* `url`: A human readable url.\n* `contents`: Contents for the asset, like the actual javascript or image or whatever.\n* `md5`: An md5 hash of the contents\n\nThese three pieces are absolutely critical.  The md5 hash is *super* important! This allows us to append our human readable url with the md5 hash for versioning which allows basically every static asset to be cached forever by proxies, browsers, cdn's.  This makes everything fast, fast, fast.\n\n### AssetRack\nAn asset rack is a collection of assets.  But it allows us to do things with assets that we always want to do very easily.  Like serve them from a memory cache using express and connect middleware, or push all individual assets to an Amazon S3 bucket, or write them to disk or whatever other group action we might want to perform on our assets.\n\n## Tutorial\nHere is a simple walk throught that demonstrates some of the\nmajor features of asset rack.\n\n### Create your Assets\nFirst create your assets.  Here we are creating our stylesheets, \njavascript code, and javascript templates from less, coffeescript and jade.\n```javascript\nvar rack = require('asset-rack');\n\nvar assets = new rack.AssetRack([\n    new rack.LessAsset({\n        url: '/style.css',\n        filename: __dirname + '/path/to/file.less'\n    }),\n    new rack.BrowserifyAsset({\n        url: '/app.js',\n        filename: __dirname + '/path/to/app.coffee'\n    }),\n    new rack.JadeAsset({\n        url: '/templates.js',\n        dirname: __dirname + '/templates'\n    })\n]);\n\nassets.on('complete', function() {\n    console.log('hey all my assets were created!');\n});\n```\n\n### Hook into Express\nOnce your assets have been created you can hook them \ninto express with ease.\n```javascript\nassets.on('complete', function() {\n    var app = express.createServer();\n    app.configure(function() {\n        app.use(assets);  // that's all you need to do\n    });\n    app.listen(8000);\n});\n```\n\nAll of those assets are now stored in an in-memroy cache, so it is super fast.\n\n### Markup Functions\n\nIn your jade templates you can include the tags by referencing their url.  For your convenience the assets object will be added to response locals, so that you can do the following in say a jade template:\n\n```\n!= assets.tag('/style.css')\n!= assets.tag('/app.js')\n!= assets.tag('/templates.js')\n```\nWhich results in the following html:\n\n```html\n<link href=\"/style-{md5-sum}.css\" rel=\"stylesheet\"></link>\n<script src=\"/templates-{md5-sum}.js\"></script>\n<script src=\"/app-{md5-sum}.js\"></script>\n```\n\nVery cool, and this will work for multi-process and multi-server.\n\nNotice the md5 sum that is now on the url.  This means you can HTML cache it forever.  Which is exactly what we do if you have the hash option set.  Also, updating your CDN is now a breeze.\n\n### Push Compiled Assets to S3\nNow that all your assets are done and hooked into express you can just\nserve them from your app, but we can do better!  Let's push them to Amazon\nAWS so they can be served by S3 or Cloudfront.\n\n\n```javascript\nassets.on('complete', function() {\n    assets.pushS3({\n        key: '<your aws key>',\n        secret: '<your aws secret>',\n        bucket: '<your aws bucket>'\n    });\n    assets.on('s3-upload-complete', function() {\n        console.log('our assets are now on amazon s3!');\n    });\n});\n```\n\n# API Reference\n\n## AssetRack\n\nThis is your initial collection of assets.\n\n```javascript\nvar assets = new AssetRack([\n    new rack.LessAsset({\n        url: '/style.css',\n        filename: __dirname + '/path/to/file.less'\n    }),\n    new rack.BrowserifyAsset({\n        url: '/app.js',\n        filename: __dirname + '/path/to/app.coffee'\n    }),\n    new rack.JadeAsset({\n        url: '/templates.js',\n        dirname: __dirname + '/templates'\n    })\n]);\n```\n\nTo use with express:\n\n```javascript\napp.use(assets);\n```\n\n### Methods\n* `tag(url)`: Given a url, returns the tag that should be used in HTML.\n* `pushS3({key:key, secret:secret, bucket:bucket})`: Pushes all asset contents to their respective \nurls in an Amazon S3 bucket.\n\n### Events\n\n* `complete`: Emitted after all assets have been created.\n* `s3-upload-complete`: Emitted after assets have been loaded to s3.\n* `error`: Emitted for any errors.\n\n## BrowserifyAsset (js/coffeescript)\n\nBrowserify is an awesome node project that converts node-style requires\nto requirejs for the frontend.  For more details, check it out,\n[here](https://github.com/substack/node-browserify).\n\n```javascript\nnew BrowserifyAsset({\n    url: '/app.js',\n    filename: __dirname + '/client/app.js',\n    compress: true\n});\n```\n\n### Options\n\n* `url`: The url that should retrieve this resource.\n* `filename`: A filename or list of filenames to be executed by the browser.\n* `require`: A filename or list of filenames to require, should not be necessary\nas the `filename` argument should pull in any requires you need.\n* `compress` (defaults to false): whether to run the javascript through a minifier.\n* `hash` (defaults to true): Set to false if you don't want the md5 sum added to your urls.\n\n## JadeAsset\nThis is an awesome asset.  Ever wanted the simplicity of jade templates\non the browser with lightning fast performance.  Here you go.\n\n```javascript\nnew JadeAsset({\n    url: '/templates.js',\n    dirname: __dirname + '/templates'\n});\n```\n\nSo if your template directory looked like this:\n\n```\nindex.jade\ncontact.jade\nuser/\n    profile.jade\n    info.jade\n```\n\nThen in the browser, you would first need to include the [jade runtime](https://github.com/visionmedia/jade/blob/master/runtime.js) script:\n\n```\nscript(src=\"/static/js/jade-runtime.js\", type=\"text/javascript\")\n```\n\nthen you could reference your templates like so:\n\n```javascript\n$('body').append(Templates['index']());\n$('body').append(Templates['user/profile']({username: 'brad', status: 'fun'}));\n$('body').append(Templates['user/info']());\n```\n### Options\n\n* `url`: The url that should retrieve this resource.\n* `dirname`: Directory where template files are located, will grab them recursively.\n* `separator` (defaults to '/'): The character that separates directories, i like to change it to an underscore, `_`.  So that you get more javascript friendly template names like `Templates.user_profile` or `Templates.friends_interests_list`.\n* `compress` (defaults to false): Whether to minify the javascript or not.\n* `clientVariable` (defaults to 'Templates'): Client side template\nvariable.\n* `hash` (defaults to true): Set to false if you don't want the md5 sum added to your urls.\n\n## LessAsset\n\nThe less asset basically compiles up and serves your less files as css.  You\ncan read more about less [here](https://github.com/cloudhead/less.js).\n\n```javascript\nnew LessAsset({\n    url: '/style.css',\n    filename: __dirname + '/style/app.less'\n});\n```\n\n### Options\n\n* `url`: The url that should retrieve this resource.\n* `hash` (defaults to true): Set to false if you don't want the md5 sum added to your urls.\n* `filename`: Filename of the less file you want to serve.\n* `compress` (defaults to false): Whether to minify the css.\n* `paths`: List of paths to search for `@import` directives.\n\n\n# License\n\n©2012 Brad Carleton, Tech Pines and available under the [MIT license](http://www.opensource.org/licenses/mit-license.php):\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","_id":"asset-rack@1.1.2","dist":{"shasum":"3c35fe891db297cb30102d61695302d94c7767b4","tarball":"https://registry.npmjs.org/asset-rack/-/asset-rack-1.1.2.tgz","integrity":"sha512-+gTqVAJ8bkf1U41aQ1yduqHytYqBgIGamLRSmy+nSsJoYtehBjrZQEESQVMylA1v2oz3MkPlNK03nI0149OHdA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDSIgWlJ5aFzXOPEPo2eUmq2ao5RnB3usXFJ+Eawm8IgQIhAJeFTuSi1Mchmntnj44COX60LEiYP2P3XTo5moswxS5w"}]},"maintainers":[{"name":"brad@techpines.com","email":"brad@techpines.com"}],"directories":{}},"1.1.3":{"name":"asset-rack","version":"1.1.3","description":"Asset management framework for nodejs","author":{"name":"Brad Carleton","email":"brad@techpines.com"},"repository":{"type":"git","url":"git://github.com/techpines/asset-rack"},"dependencies":{"coffee-script":"1.3.1","browserify":"1.13.5","uglify-js":"1.3.0","async":"0.1.22","knox":"0.0.9","less":"1.3.0","jade":"0.27.0","mime":"1.2.6"},"main":"switch.js","engines":{"node":">= 0.5.0"},"readme":"\n![asset-rack!](http://www.techpines.com/static/logo/asset-rack.png)\n\nA node-style asset management framework. Designed for Single Page Apps.\n\nInspired by Trevor Burnham's [connect-assets](https://github.com/TrevorBurnham/connect-assets), and the Rails [Asset Pipeline](http://guides.rubyonrails.org/asset_pipeline.html)\n\n* __Orignal Author__: Brad Carleton\n* __Company__: Tech Pines\n* __Blog Intro__: [Introducing AssetRack](http://www.techpines.com/blog/asset-rack-dynamic-asset-management-nodejs)\n\n## Features\n\n1. Dynamic asset creation for js, css, html templates.\n2. Support for js/coffescript, browserify (node-style requires).\n3. Support for less.\n4. Support for jade templates.\n4. Multi-process, multi-server out of the box.  Share nothing.\n5. Filenames hashed for \"forever\" HTML caching and easy CDN updates.\n6. No need to ever compile static files to disk, all-in memory.\n7. Ability to push compiled files to Amazon S3 for use with Cloudfront.\n8. Can be plugged into express as connect middleware.\n9. Easily extensible.\n\n## Install\n\n```bash\nnpm install asset-rack\n```\n\n## Concepts\n\nThere are two very simple conepts to understand with asset-rack.\n\n### Asset\nAn asset after it is `complete`, consists of three very important things.\n* `url`: A human readable url.\n* `contents`: Contents for the asset, like the actual javascript or image or whatever.\n* `md5`: An md5 hash of the contents\n\nThese three pieces are absolutely critical.  The md5 hash is *super* important! This allows us to append our human readable url with the md5 hash for versioning which allows basically every static asset to be cached forever by proxies, browsers, cdn's.  This makes everything fast, fast, fast.\n\n### AssetRack\nAn asset rack is a collection of assets.  But it allows us to do things with assets that we always want to do very easily.  Like serve them from a memory cache using express and connect middleware, or push all individual assets to an Amazon S3 bucket, or write them to disk or whatever other group action we might want to perform on our assets.\n\n## Tutorial\nHere is a simple walk throught that demonstrates some of the\nmajor features of asset rack.\n\n### Create your Assets\nFirst create your assets.  Here we are creating our stylesheets, \njavascript code, and javascript templates from less, coffeescript and jade.\n```javascript\nvar rack = require('asset-rack');\n\nvar assets = new rack.AssetRack([\n    new rack.LessAsset({\n        url: '/style.css',\n        filename: __dirname + '/path/to/file.less'\n    }),\n    new rack.BrowserifyAsset({\n        url: '/app.js',\n        filename: __dirname + '/path/to/app.coffee'\n    }),\n    new rack.JadeAsset({\n        url: '/templates.js',\n        dirname: __dirname + '/templates'\n    })\n]);\n\nassets.on('complete', function() {\n    console.log('hey all my assets were created!');\n});\n```\n\n### Hook into Express\nOnce your assets have been created you can hook them \ninto express with ease.\n```javascript\nassets.on('complete', function() {\n    var app = express.createServer();\n    app.configure(function() {\n        app.use(assets);  // that's all you need to do\n    });\n    app.listen(8000);\n});\n```\n\nAll of those assets are now stored in an in-memroy cache, so it is super fast.\n\n### Markup Functions\n\nIn your jade templates you can include the tags by referencing their url.  For your convenience the assets object will be added to response locals, so that you can do the following in say a jade template:\n\n```\n!= assets.tag('/style.css')\n!= assets.tag('/app.js')\n!= assets.tag('/templates.js')\n```\nWhich results in the following html:\n\n```html\n<link href=\"/style-{md5-sum}.css\" rel=\"stylesheet\"></link>\n<script src=\"/templates-{md5-sum}.js\"></script>\n<script src=\"/app-{md5-sum}.js\"></script>\n```\n\nVery cool, and this will work for multi-process and multi-server.\n\nNotice the md5 sum that is now on the url.  This means you can HTML cache it forever.  Which is exactly what we do if you have the hash option set.  Also, updating your CDN is now a breeze.\n\n### Push Compiled Assets to S3\nNow that all your assets are done and hooked into express you can just\nserve them from your app, but we can do better!  Let's push them to Amazon\nAWS so they can be served by S3 or Cloudfront.\n\n\n```javascript\nassets.on('complete', function() {\n    assets.pushS3({\n        key: '<your aws key>',\n        secret: '<your aws secret>',\n        bucket: '<your aws bucket>'\n    });\n    assets.on('s3-upload-complete', function() {\n        console.log('our assets are now on amazon s3!');\n    });\n});\n```\n\n# API Reference\n\n## AssetRack\n\nThis is your initial collection of assets.\n\n```javascript\nvar assets = new AssetRack([\n    new rack.LessAsset({\n        url: '/style.css',\n        filename: __dirname + '/path/to/file.less'\n    }),\n    new rack.BrowserifyAsset({\n        url: '/app.js',\n        filename: __dirname + '/path/to/app.coffee'\n    }),\n    new rack.JadeAsset({\n        url: '/templates.js',\n        dirname: __dirname + '/templates'\n    })\n]);\n```\n\nTo use with express:\n\n```javascript\napp.use(assets);\n```\n\n### Methods\n* `tag(url)`: Given a url, returns the tag that should be used in HTML.\n* `pushS3({key:key, secret:secret, bucket:bucket})`: Pushes all asset contents to their respective \nurls in an Amazon S3 bucket.\n\n### Events\n\n* `complete`: Emitted after all assets have been created.\n* `s3-upload-complete`: Emitted after assets have been loaded to s3.\n* `error`: Emitted for any errors.\n\n## BrowserifyAsset (js/coffeescript)\n\nBrowserify is an awesome node project that converts node-style requires\nto requirejs for the frontend.  For more details, check it out,\n[here](https://github.com/substack/node-browserify).\n\n```javascript\nnew BrowserifyAsset({\n    url: '/app.js',\n    filename: __dirname + '/client/app.js',\n    compress: true\n});\n```\n\n### Options\n\n* `url`: The url that should retrieve this resource.\n* `filename`: A filename or list of filenames to be executed by the browser.\n* `require`: A filename or list of filenames to require, should not be necessary\nas the `filename` argument should pull in any requires you need.\n* `compress` (defaults to false): whether to run the javascript through a minifier.\n* `hash` (defaults to true): Set to false if you don't want the md5 sum added to your urls.\n\n## JadeAsset\nThis is an awesome asset.  Ever wanted the simplicity of jade templates\non the browser with lightning fast performance.  Here you go.\n\n```javascript\nnew JadeAsset({\n    url: '/templates.js',\n    dirname: __dirname + '/templates'\n});\n```\n\nSo if your template directory looked like this:\n\n```\nindex.jade\ncontact.jade\nuser/\n    profile.jade\n    info.jade\n```\n\nThen in the browser, you would first need to include the [jade runtime](https://github.com/visionmedia/jade/blob/master/runtime.js) script:\n\n```\nscript(src=\"/static/js/jade-runtime.js\", type=\"text/javascript\")\n```\n\nthen you could reference your templates like so:\n\n```javascript\n$('body').append(Templates['index']());\n$('body').append(Templates['user/profile']({username: 'brad', status: 'fun'}));\n$('body').append(Templates['user/info']());\n```\n### Options\n\n* `url`: The url that should retrieve this resource.\n* `dirname`: Directory where template files are located, will grab them recursively.\n* `separator` (defaults to '/'): The character that separates directories, i like to change it to an underscore, `_`.  So that you get more javascript friendly template names like `Templates.user_profile` or `Templates.friends_interests_list`.\n* `compress` (defaults to false): Whether to minify the javascript or not.\n* `clientVariable` (defaults to 'Templates'): Client side template\nvariable.\n* `hash` (defaults to true): Set to false if you don't want the md5 sum added to your urls.\n\n## LessAsset\n\nThe less asset basically compiles up and serves your less files as css.  You\ncan read more about less [here](https://github.com/cloudhead/less.js).\n\n```javascript\nnew LessAsset({\n    url: '/style.css',\n    filename: __dirname + '/style/app.less'\n});\n```\n\n### Options\n\n* `url`: The url that should retrieve this resource.\n* `hash` (defaults to true): Set to false if you don't want the md5 sum added to your urls.\n* `filename`: Filename of the less file you want to serve.\n* `compress` (defaults to false): Whether to minify the css.\n* `paths`: List of paths to search for `@import` directives.\n\n\n# License\n\n©2012 Brad Carleton, Tech Pines and available under the [MIT license](http://www.opensource.org/licenses/mit-license.php):\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","_id":"asset-rack@1.1.3","dist":{"shasum":"60df976fa917b85cbdc2e9678b65f270844c7279","tarball":"https://registry.npmjs.org/asset-rack/-/asset-rack-1.1.3.tgz","integrity":"sha512-J8Obqv9ykoEgHpLq7LHgML8zOaQVS+fRu7i0X3XRwo/tYtS1TIsQB61RuU0o9hiyhJ7evfb3VjnP/h/iLzrDjg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCBVvCFDcu++QDcoJ1YG4a2DaOyQBL6UgacPT9MeND3+AIhAJkxEk1dZPwUnPZXugc9MVBYyQpknTISh8nYVY9tCuay"}]},"maintainers":[{"name":"brad@techpines.com","email":"brad@techpines.com"}],"directories":{}},"1.1.4":{"name":"asset-rack","version":"1.1.4","description":"Asset management framework for nodejs","author":{"name":"Brad Carleton","email":"brad@techpines.com"},"repository":{"type":"git","url":"git://github.com/techpines/asset-rack"},"dependencies":{"coffee-script":"1.3.1","browserify":"1.13.5","uglify-js":"1.3.0","async":"0.1.22","knox":"0.0.9","less":"1.3.0","jade":"0.27.0","mime":"1.2.6"},"main":"switch.js","engines":{"node":">= 0.5.0"},"readme":"\n![asset-rack!](http://www.techpines.com/static/logo/asset-rack.png)\n\nA node-style asset management framework. Designed for Single Page Apps.\n\nInspired by Trevor Burnham's [connect-assets](https://github.com/TrevorBurnham/connect-assets), and the Rails [Asset Pipeline](http://guides.rubyonrails.org/asset_pipeline.html)\n\n* __Orignal Author__: Brad Carleton\n* __Company__: Tech Pines\n* __Blog Intro__: [Introducing AssetRack](http://www.techpines.com/blog/asset-rack-dynamic-asset-management-nodejs)\n\n## Features\n\n1. Dynamic asset creation for js, css, html templates.\n2. Support for js/coffescript, browserify (node-style requires).\n3. Support for less.\n4. Support for jade templates.\n4. Multi-process, multi-server out of the box.  Share nothing.\n5. Filenames hashed for \"forever\" HTML caching and easy CDN updates.\n6. No need to ever compile static files to disk, all-in memory.\n7. Ability to push compiled files to Amazon S3 for use with Cloudfront.\n8. Can be plugged into express as connect middleware.\n9. Easily extensible.\n\n## Install\n\n```bash\nnpm install asset-rack\n```\n\n## Concepts\n\nThere are two very simple conepts to understand with asset-rack.\n\n### Asset\nAn asset after it is `complete`, consists of three very important things.\n* `url`: A human readable url.\n* `contents`: Contents for the asset, like the actual javascript or image or whatever.\n* `md5`: An md5 hash of the contents\n\nThese three pieces are absolutely critical.  The md5 hash is *super* important! This allows us to append our human readable url with the md5 hash for versioning which allows basically every static asset to be cached forever by proxies, browsers, cdn's.  This makes everything fast, fast, fast.\n\n### AssetRack\nAn asset rack is a collection of assets.  But it allows us to do things with assets that we always want to do very easily.  Like serve them from a memory cache using express and connect middleware, or push all individual assets to an Amazon S3 bucket, or write them to disk or whatever other group action we might want to perform on our assets.\n\n## Tutorial\nHere is a simple walk throught that demonstrates some of the\nmajor features of asset rack.\n\n### Create your Assets\nFirst create your assets.  Here we are creating our stylesheets, \njavascript code, and javascript templates from less, coffeescript and jade.\n```javascript\nvar rack = require('asset-rack');\n\nvar assets = new rack.AssetRack([\n    new rack.LessAsset({\n        url: '/style.css',\n        filename: __dirname + '/path/to/file.less'\n    }),\n    new rack.BrowserifyAsset({\n        url: '/app.js',\n        filename: __dirname + '/path/to/app.coffee'\n    }),\n    new rack.JadeAsset({\n        url: '/templates.js',\n        dirname: __dirname + '/templates'\n    })\n]);\n\nassets.on('complete', function() {\n    console.log('hey all my assets were created!');\n});\n```\n\n### Hook into Express\nOnce your assets have been created you can hook them \ninto express with ease.\n```javascript\nassets.on('complete', function() {\n    var app = express.createServer();\n    app.configure(function() {\n        app.use(assets);  // that's all you need to do\n    });\n    app.listen(8000);\n});\n```\n\nAll of those assets are now stored in an in-memroy cache, so it is super fast.\n\n### Markup Functions\n\nIn your jade templates you can include the tags by referencing their url.  For your convenience the assets object will be added to response locals, so that you can do the following in say a jade template:\n\n```\n!= assets.tag('/style.css')\n!= assets.tag('/app.js')\n!= assets.tag('/templates.js')\n```\nWhich results in the following html:\n\n```html\n<link href=\"/style-{md5-sum}.css\" rel=\"stylesheet\"></link>\n<script src=\"/templates-{md5-sum}.js\"></script>\n<script src=\"/app-{md5-sum}.js\"></script>\n```\n\nVery cool, and this will work for multi-process and multi-server.\n\nNotice the md5 sum that is now on the url.  This means you can HTML cache it forever.  Which is exactly what we do if you have the hash option set.  Also, updating your CDN is now a breeze.\n\n### Push Compiled Assets to S3\nNow that all your assets are done and hooked into express you can just\nserve them from your app, but we can do better!  Let's push them to Amazon\nAWS so they can be served by S3 or Cloudfront.\n\n\n```javascript\nassets.on('complete', function() {\n    assets.pushS3({\n        key: '<your aws key>',\n        secret: '<your aws secret>',\n        bucket: '<your aws bucket>'\n    });\n    assets.on('s3-upload-complete', function() {\n        console.log('our assets are now on amazon s3!');\n    });\n});\n```\n\n# API Reference\n\n## AssetRack\n\nThis is your initial collection of assets.\n\n```javascript\nvar assets = new AssetRack([\n    new rack.LessAsset({\n        url: '/style.css',\n        filename: __dirname + '/path/to/file.less'\n    }),\n    new rack.BrowserifyAsset({\n        url: '/app.js',\n        filename: __dirname + '/path/to/app.coffee'\n    }),\n    new rack.JadeAsset({\n        url: '/templates.js',\n        dirname: __dirname + '/templates'\n    })\n]);\n```\n\nTo use with express:\n\n```javascript\napp.use(assets);\n```\n\n### Methods\n* `tag(url)`: Given a url, returns the tag that should be used in HTML.\n* `pushS3({key:key, secret:secret, bucket:bucket})`: Pushes all asset contents to their respective \nurls in an Amazon S3 bucket.\n\n### Events\n\n* `complete`: Emitted after all assets have been created.\n* `s3-upload-complete`: Emitted after assets have been loaded to s3.\n* `error`: Emitted for any errors.\n\n## BrowserifyAsset (js/coffeescript)\n\nBrowserify is an awesome node project that converts node-style requires\nto requirejs for the frontend.  For more details, check it out,\n[here](https://github.com/substack/node-browserify).\n\n```javascript\nnew BrowserifyAsset({\n    url: '/app.js',\n    filename: __dirname + '/client/app.js',\n    compress: true\n});\n```\n\n### Options\n\n* `url`: The url that should retrieve this resource.\n* `filename`: A filename or list of filenames to be executed by the browser.\n* `require`: A filename or list of filenames to require, should not be necessary\nas the `filename` argument should pull in any requires you need.\n* `compress` (defaults to false): whether to run the javascript through a minifier.\n* `hash` (defaults to true): Set to false if you don't want the md5 sum added to your urls.\n\n## JadeAsset\nThis is an awesome asset.  Ever wanted the simplicity of jade templates\non the browser with lightning fast performance.  Here you go.\n\n```javascript\nnew JadeAsset({\n    url: '/templates.js',\n    dirname: __dirname + '/templates'\n});\n```\n\nSo if your template directory looked like this:\n\n```\nindex.jade\ncontact.jade\nuser/\n    profile.jade\n    info.jade\n```\n\nThen in the browser, you would first need to include the [jade runtime](https://github.com/visionmedia/jade/blob/master/runtime.js) script:\n\n```\nscript(src=\"/static/js/jade-runtime.js\", type=\"text/javascript\")\n```\n\nthen you could reference your templates like so:\n\n```javascript\n$('body').append(Templates['index']());\n$('body').append(Templates['user/profile']({username: 'brad', status: 'fun'}));\n$('body').append(Templates['user/info']());\n```\n### Options\n\n* `url`: The url that should retrieve this resource.\n* `dirname`: Directory where template files are located, will grab them recursively.\n* `separator` (defaults to '/'): The character that separates directories, i like to change it to an underscore, `_`.  So that you get more javascript friendly template names like `Templates.user_profile` or `Templates.friends_interests_list`.\n* `compress` (defaults to false): Whether to minify the javascript or not.\n* `clientVariable` (defaults to 'Templates'): Client side template\nvariable.\n* `hash` (defaults to true): Set to false if you don't want the md5 sum added to your urls.\n\n## LessAsset\n\nThe less asset basically compiles up and serves your less files as css.  You\ncan read more about less [here](https://github.com/cloudhead/less.js).\n\n```javascript\nnew LessAsset({\n    url: '/style.css',\n    filename: __dirname + '/style/app.less'\n});\n```\n\n### Options\n\n* `url`: The url that should retrieve this resource.\n* `hash` (defaults to true): Set to false if you don't want the md5 sum added to your urls.\n* `filename`: Filename of the less file you want to serve.\n* `compress` (defaults to false): Whether to minify the css.\n* `paths`: List of paths to search for `@import` directives.\n\n\n# License\n\n©2012 Brad Carleton, Tech Pines and available under the [MIT license](http://www.opensource.org/licenses/mit-license.php):\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","_id":"asset-rack@1.1.4","dist":{"shasum":"27cebd510c73f6424f994d9403fd89d07dff526c","tarball":"https://registry.npmjs.org/asset-rack/-/asset-rack-1.1.4.tgz","integrity":"sha512-F3AewH2kkjEzMVr5Ta1pSZxCoNV+rmXRj3Eg8vjVDDe1Qf/dfFKIPf5RhyKrxatd+0MIPzBGU7z1+P0ZQCufPQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDzr12zrnVuuFmED+unsxb0keQ7xiBR8pnywGj345Y2hwIgSpHvZ8iyQMzZrVVQoNnJLj1NFlEJUGNFPVmfDI8Mnno="}]},"maintainers":[{"name":"brad@techpines.com","email":"brad@techpines.com"}],"directories":{}},"1.1.5":{"name":"asset-rack","version":"1.1.5","description":"Asset management framework for nodejs","author":{"name":"Brad Carleton","email":"brad@techpines.com"},"repository":{"type":"git","url":"git://github.com/techpines/asset-rack"},"dependencies":{"coffee-script":"1.3.1","browserify":"1.16.1","uglify-js":"1.3.4","async":"0.1.22","knox":"0.0.9","less":"1.3.1","jade":"0.27.0","mime":"1.2.6"},"main":"switch.js","engines":{"node":">= 0.5.0"},"readme":"\n![asset-rack!](http://www.techpines.com/static/logo/asset-rack.png)\n\nA node-style asset management framework. Designed for Single Page Apps.\n\nInspired by Trevor Burnham's [connect-assets](https://github.com/TrevorBurnham/connect-assets), and the Rails [Asset Pipeline](http://guides.rubyonrails.org/asset_pipeline.html)\n\n* __Orignal Author__: Brad Carleton\n* __Company__: Tech Pines\n* __Blog Intro__: [Introducing AssetRack](http://www.techpines.com/blog/asset-rack-dynamic-asset-management-nodejs)\n\n## Features\n\n1. Dynamic asset creation for js, css, html templates.\n2. Support for js/coffescript, browserify (node-style requires).\n3. Support for less.\n4. Support for jade templates.\n5. Support for angularjs templates.\n6. Multi-process, multi-server out of the box.  Share nothing.\n7. Filenames hashed for \"forever\" HTML caching and easy CDN updates.\n8. No need to ever compile static files to disk, all-in memory.\n9. Ability to push compiled files to Amazon S3 for use with Cloudfront.\n10. Can be plugged into express as connect middleware.\n11. Easily extensible.\n\n## Install\n\n```bash\nnpm install asset-rack\n```\n\n## Concepts\n\nThere are two very simple conepts to understand with asset-rack.\n\n### Asset\nAn asset after it is `complete`, consists of three very important things.\n* `url`: A human readable url.\n* `contents`: Contents for the asset, like the actual javascript or image or whatever.\n* `md5`: An md5 hash of the contents\n\nThese three pieces are absolutely critical.  The md5 hash is *super* important! This allows us to append our human readable url with the md5 hash for versioning which allows basically every static asset to be cached forever by proxies, browsers, cdn's.  This makes everything fast, fast, fast.\n\n### AssetRack\nAn asset rack is a collection of assets.  But it allows us to do things with assets that we always want to do very easily.  Like serve them from a memory cache using express and connect middleware, or push all individual assets to an Amazon S3 bucket, or write them to disk or whatever other group action we might want to perform on our assets.\n\n## Tutorial\nHere is a simple walk throught that demonstrates some of the\nmajor features of asset rack.\n\n### Create your Assets\nFirst create your assets.  Here we are creating our stylesheets,\njavascript code, and javascript templates from less, coffeescript and jade.\n```javascript\nvar rack = require('asset-rack');\n\nvar assets = new rack.AssetRack([\n    new rack.LessAsset({\n        url: '/style.css',\n        filename: __dirname + '/path/to/file.less'\n    }),\n    new rack.BrowserifyAsset({\n        url: '/app.js',\n        filename: __dirname + '/path/to/app.coffee'\n    }),\n    new rack.JadeAsset({\n        url: '/templates.js',\n        dirname: __dirname + '/templates'\n    })\n]);\n\nassets.on('complete', function() {\n    console.log('hey all my assets were created!');\n});\n```\n\n### Hook into Express\nOnce your assets have been created you can hook them\ninto express with ease.\n```javascript\nassets.on('complete', function() {\n    var app = express.createServer();\n    app.configure(function() {\n        app.use(assets);  // that's all you need to do\n    });\n    app.listen(8000);\n});\n```\n\nAll of those assets are now stored in an in-memroy cache, so it is super fast.\n\n### Markup Functions\n\nIn your jade templates you can include the tags by referencing their url.  For your convenience the assets object will be added to response locals, so that you can do the following in say a jade template:\n\n```\n!= assets.tag('/style.css')\n!= assets.tag('/app.js')\n!= assets.tag('/templates.js')\n```\nWhich results in the following html:\n\n```html\n<link href=\"/style-{md5-sum}.css\" rel=\"stylesheet\"></link>\n<script src=\"/templates-{md5-sum}.js\"></script>\n<script src=\"/app-{md5-sum}.js\"></script>\n```\n\nVery cool, and this will work for multi-process and multi-server.\n\nNotice the md5 sum that is now on the url.  This means you can HTML cache it forever.  Which is exactly what we do if you have the hash option set.  Also, updating your CDN is now a breeze.\n\n### Push Compiled Assets to S3\nNow that all your assets are done and hooked into express you can just\nserve them from your app, but we can do better!  Let's push them to Amazon\nAWS so they can be served by S3 or Cloudfront.\n\n\n```javascript\nassets.on('complete', function() {\n    assets.pushS3({\n        key: '<your aws key>',\n        secret: '<your aws secret>',\n        bucket: '<your aws bucket>'\n    });\n    assets.on('s3-upload-complete', function() {\n        console.log('our assets are now on amazon s3!');\n    });\n});\n```\n\n# API Reference\n\n## AssetRack\n\nThis is your initial collection of assets.\n\n```javascript\nvar assets = new AssetRack([\n    new rack.LessAsset({\n        url: '/style.css',\n        filename: __dirname + '/path/to/file.less'\n    }),\n    new rack.BrowserifyAsset({\n        url: '/app.js',\n        filename: __dirname + '/path/to/app.coffee'\n    }),\n    new rack.JadeAsset({\n        url: '/templates.js',\n        dirname: __dirname + '/templates'\n    })\n]);\n```\n\nTo use with express:\n\n```javascript\napp.use(assets);\n```\n\n### Methods\n* `tag(url)`: Given a url, returns the tag that should be used in HTML.\n* `pushS3({key:key, secret:secret, bucket:bucket})`: Pushes all asset contents to their respective\nurls in an Amazon S3 bucket.\n\n### Events\n\n* `complete`: Emitted after all assets have been created.\n* `s3-upload-complete`: Emitted after assets have been loaded to s3.\n* `error`: Emitted for any errors.\n\n## BrowserifyAsset (js/coffeescript)\n\nBrowserify is an awesome node project that converts node-style requires\nto requirejs for the frontend.  For more details, check it out,\n[here](https://github.com/substack/node-browserify).\n\n```javascript\nnew BrowserifyAsset({\n    url: '/app.js',\n    filename: __dirname + '/client/app.js',\n    compress: true\n});\n```\n\n### Options\n\n* `url`: The url that should retrieve this resource.\n* `filename`: A filename or list of filenames to be executed by the browser.\n* `require`: A filename or list of filenames to require, should not be necessary\nas the `filename` argument should pull in any requires you need.\n* `debug` (defaults to false): enables the browserify debug option.\n* `compress` (defaults to false): whether to run the javascript through a minifier.\n* `extensionHandlers` (defaults to []): an array of custom extensions and associated handler function. eg: `[{ ext: 'handlebars', handler: handlebarsCompilerFunction }]`\n* `hash` (defaults to true): Set to false if you don't want the md5 sum added to your urls.\n\n## JadeAsset\nThis is an awesome asset.  Ever wanted the simplicity of jade templates\non the browser with lightning fast performance.  Here you go.\n\n```javascript\nnew JadeAsset({\n    url: '/templates.js',\n    dirname: __dirname + '/templates'\n});\n```\n\nSo if your template directory looked like this:\n\n```\nindex.jade\ncontact.jade\nuser/\n    profile.jade\n    info.jade\n```\n\nThen in the browser, you would first need to include the [jade runtime](https://github.com/visionmedia/jade/blob/master/runtime.js) script:\n\n```\nscript(src=\"/static/js/jade-runtime.js\", type=\"text/javascript\")\n```\n\nthen you could reference your templates like so:\n\n```javascript\n$('body').append(Templates['index']());\n$('body').append(Templates['user/profile']({username: 'brad', status: 'fun'}));\n$('body').append(Templates['user/info']());\n```\n### Options\n\n* `url`: The url that should retrieve this resource.\n* `dirname`: Directory where template files are located, will grab them recursively.\n* `separator` (defaults to '/'): The character that separates directories, i like to change it to an underscore, `_`.  So that you get more javascript friendly template names like `Templates.user_profile` or `Templates.friends_interests_list`.\n* `compress` (defaults to false): Whether to minify the javascript or not.\n* `clientVariable` (defaults to 'Templates'): Client side template\nvariable.\n* `hash` (defaults to true): Set to false if you don't want the md5 sum added to your urls.\n\n## AngularTemplatesAsset\n\nThe angular templates asset packages all .html templates ready to be injected into the client side angularjs template cache.\nYou can read more about angularjs [here](http://angularjs.org/).\n\n```javascript\nnew AngularTemplatesAsset({\n    url: '/js/templates.js',\n    directory: __dirname + '/templates'\n});\n```\n\nThen see the following example client js code which loads templates into the template cache, where `angularTemplates` is the function provided by AngularTemplatesAsset:\n\n```javascript\n//replace this with your module initialization logic\nvar myApp = angular.module(\"myApp\", []);\n\n//use this line to add the templates to the cache\nmyApp.run(['$templateCache', angularTemplates]);\n```\n\n### Options\n\n* `url`: The url that should retrieve this resource.\n* `hash` (defaults to true): Set to false if you don't want the md5 sum added to your urls.\n* `directory`: Directory where the .html templates are stored.\n* `compress` (defaults to false): Whether to unglify the js.\n\n## LessAsset\n\nThe less asset basically compiles up and serves your less files as css.  You\ncan read more about less [here](https://github.com/cloudhead/less.js).\n\n```javascript\nnew LessAsset({\n    url: '/style.css',\n    filename: __dirname + '/style/app.less'\n});\n```\n\n### Options\n\n* `url`: The url that should retrieve this resource.\n* `hash` (defaults to true): Set to false if you don't want the md5 sum added to your urls.\n* `filename`: Filename of the less file you want to serve.\n* `compress` (defaults to false): Whether to minify the css.\n* `paths`: List of paths to search for `@import` directives.\n\n\n# License\n\n©2012 Brad Carleton, Tech Pines and available under the [MIT license](http://www.opensource.org/licenses/mit-license.php):\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","readmeFilename":"README.md","_id":"asset-rack@1.1.5","dist":{"shasum":"8b5af4795fdf107881f92127421cb83424a246be","tarball":"https://registry.npmjs.org/asset-rack/-/asset-rack-1.1.5.tgz","integrity":"sha512-BCsz3GYt0Gvc7g8udXKAyhdB8TqoyOpkxZ9vSTI+WnKMJ9u7BeKE5o4k0WCoaXoTel+1P+bJPaPYs1D/0opPHQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDIrxiV0yS1nOSd+e054N2P61RKHLprr48hjtReDTzOhQIgW8X7ONfjDsxzWzcTWhWcjFf3h+D1l6iECkDCQKfVCJU="}]},"_npmVersion":"1.1.65","_npmUser":{"name":"brad@techpines.com","email":"brad@techpines.com"},"maintainers":[{"name":"brad@techpines.com","email":"brad@techpines.com"}],"directories":{}},"1.1.6":{"name":"asset-rack","version":"1.1.6","description":"Asset management framework for nodejs","author":{"name":"Brad Carleton","email":"brad@techpines.com"},"repository":{"type":"git","url":"git://github.com/techpines/asset-rack"},"dependencies":{"coffee-script":"1.4.0","browserify":"1.16.6","snockets":"1.3.8","uglify-js":"2.2.2","async":"0.1.22","knox":"0.4.5","less":"1.3.1","jade":"0.27.7","mime":"1.2.7"},"main":"switch.js","engines":{"node":">= 0.5.0"},"readme":"\n![asset-rack!](http://www.techpines.com/static/logo/asset-rack.png)\n\nA node-style asset management framework. Designed for Single Page Apps.\n\nInspired by Trevor Burnham's [connect-assets](https://github.com/TrevorBurnham/connect-assets), and the Rails [Asset Pipeline](http://guides.rubyonrails.org/asset_pipeline.html)\n\n* __Orignal Author__: Brad Carleton\n* __Company__: Tech Pines\n* __Blog Intro__: [Introducing AssetRack](http://www.techpines.com/blog/asset-rack-dynamic-asset-management-nodejs)\n\n## Features\n\n1. Dynamic asset creation for js, css, html templates.\n2. Support for js/coffescript, browserify (node-style requires).\n3. Support for snockets (Rails/Sprockets-style comments to indicate dependencies).\n4. Support for less.\n5. Support for jade templates.\n6. Support for angularjs templates.\n7. Multi-process, multi-server out of the box.  Share nothing.\n8. Filenames hashed for \"forever\" HTML caching and easy CDN updates.\n9. No need to ever compile static files to disk, all-in memory.\n10. Ability to push compiled files to Amazon S3 for use with Cloudfront.\n11. Can be plugged into express as connect middleware.\n12. Easily extensible.\n\n## Install\n\n```bash\nnpm install asset-rack\n```\n\n## Concepts\n\nThere are two very simple conepts to understand with asset-rack.\n\n### Asset\nAn asset after it is `complete`, consists of three very important things.\n* `url`: A human readable url.\n* `contents`: Contents for the asset, like the actual javascript or image or whatever.\n* `md5`: An md5 hash of the contents\n\nThese three pieces are absolutely critical.  The md5 hash is *super* important! This allows us to append our human readable url with the md5 hash for versioning which allows basically every static asset to be cached forever by proxies, browsers, cdn's.  This makes everything fast, fast, fast.\n\n### AssetRack\nAn asset rack is a collection of assets.  But it allows us to do things with assets that we always want to do very easily.  Like serve them from a memory cache using express and connect middleware, or push all individual assets to an Amazon S3 bucket, or write them to disk or whatever other group action we might want to perform on our assets.\n\n## Tutorial\nHere is a simple walk throught that demonstrates some of the\nmajor features of asset rack.\n\n### Create your Assets\nFirst create your assets.  Here we are creating our stylesheets,\njavascript code, and javascript templates from less, coffeescript and jade.\n```javascript\nvar rack = require('asset-rack');\n\nvar assets = new rack.AssetRack([\n    new rack.LessAsset({\n        url: '/style.css',\n        filename: __dirname + '/path/to/file.less'\n    }),\n    new rack.BrowserifyAsset({\n        url: '/app.js',\n        filename: __dirname + '/path/to/app.coffee'\n    }),\n    new rack.JadeAsset({\n        url: '/templates.js',\n        dirname: __dirname + '/templates'\n    })\n]);\n\nassets.on('complete', function() {\n    console.log('hey all my assets were created!');\n});\n```\n\n### Hook into Express\nOnce your assets have been created you can hook them\ninto express with ease.\n```javascript\nassets.on('complete', function() {\n    var app = express.createServer();\n    app.configure(function() {\n        app.use(assets);  // that's all you need to do\n    });\n    app.listen(8000);\n});\n```\n\nAll of those assets are now stored in an in-memroy cache, so it is super fast.\n\n### Markup Functions\n\nIn your jade templates you can include the tags by referencing their url.  For your convenience the assets object will be added to response locals, so that you can do the following in say a jade template:\n\n```\n!= assets.tag('/style.css')\n!= assets.tag('/app.js')\n!= assets.tag('/templates.js')\n```\nWhich results in the following html:\n\n```html\n<link href=\"/style-{md5-sum}.css\" rel=\"stylesheet\"></link>\n<script src=\"/templates-{md5-sum}.js\"></script>\n<script src=\"/app-{md5-sum}.js\"></script>\n```\n\nVery cool, and this will work for multi-process and multi-server.\n\nNotice the md5 sum that is now on the url.  This means you can HTML cache it forever.  Which is exactly what we do if you have the hash option set.  Also, updating your CDN is now a breeze.\n\n### Push Compiled Assets to S3\nNow that all your assets are done and hooked into express you can just\nserve them from your app, but we can do better!  Let's push them to Amazon\nAWS so they can be served by S3 or Cloudfront.\n\n\n```javascript\nassets.on('complete', function() {\n    assets.pushS3({\n        key: '<your aws key>',\n        secret: '<your aws secret>',\n        bucket: '<your aws bucket>'\n    });\n    assets.on('s3-upload-complete', function() {\n        console.log('our assets are now on amazon s3!');\n    });\n});\n```\n\n# API Reference\n\n## AssetRack\n\nThis is your initial collection of assets.\n\n```javascript\nvar assets = new AssetRack([\n    new rack.LessAsset({\n        url: '/style.css',\n        filename: __dirname + '/path/to/file.less'\n    }),\n    new rack.BrowserifyAsset({\n        url: '/app.js',\n        filename: __dirname + '/path/to/app.coffee'\n    }),\n    new rack.JadeAsset({\n        url: '/templates.js',\n        dirname: __dirname + '/templates'\n    })\n]);\n```\n\nTo use with express:\n\n```javascript\napp.use(assets);\n```\n\n### Methods\n* `tag(url)`: Given a url, returns the tag that should be used in HTML.\n* `pushS3({key:key, secret:secret, bucket:bucket})`: Pushes all asset contents to their respective\nurls in an Amazon S3 bucket.\n\n### Events\n\n* `complete`: Emitted after all assets have been created.\n* `s3-upload-complete`: Emitted after assets have been loaded to s3.\n* `error`: Emitted for any errors.\n\n## BrowserifyAsset (js/coffeescript)\n\nBrowserify is an awesome node project that converts node-style requires\nto requirejs for the frontend.  For more details, check it out,\n[here](https://github.com/substack/node-browserify).\n\n```javascript\nnew BrowserifyAsset({\n    url: '/app.js',\n    filename: __dirname + '/client/app.js',\n    compress: true\n});\n```\n\n### Options\n\n* `url`: The url that should retrieve this resource.\n* `filename`: A filename or list of filenames to be executed by the browser.\n* `require`: A filename or list of filenames to require, should not be necessary\nas the `filename` argument should pull in any requires you need.\n* `debug` (defaults to false): enables the browserify debug option.\n* `compress` (defaults to false): whether to run the javascript through a minifier.\n* `extensionHandlers` (defaults to []): an array of custom extensions and associated handler function. eg: `[{ ext: 'handlebars', handler: handlebarsCompilerFunction }]`\n* `hash` (defaults to true): Set to false if you don't want the md5 sum added to your urls.\n\n## Snockets (js/coffeescript)\n\nSnockets is a JavaScript/CoffeeScript concatenation tool for Node.js inspired by Sprockets. Used by connect-assets to create a Rails 3.1-style asset pipeline.  For more details, check it out,\n[here](https://github.com/TrevorBurnham/snockets).\n\n```javascript\nnew SnocketsAsset({\n    url: '/app.js',\n    filename: __dirname + '/client/app.js',\n    compress: true\n});\n```\n\n### Options\n\n* `url`: The url that should retrieve this resource.\n* `filename`: A filename or list of filenames to be executed by the browser.\n* `compress` (defaults to false): whether to run the javascript through a minifier.\n* `extensionHandlers` (defaults to []): an array of custom extensions and associated handler function. eg: `[{ ext: 'handlebars', handler: handlebarsCompilerFunction }]`\n* `debug` (defaults to false): output scripts via eval with trailing //@ sourceURL\n* `hash` (defaults to true): Set to false if you don't want the md5 sum added to your urls.\n\n## JadeAsset\nThis is an awesome asset.  Ever wanted the simplicity of jade templates\non the browser with lightning fast performance.  Here you go.\n\n```javascript\nnew JadeAsset({\n    url: '/templates.js',\n    dirname: __dirname + '/templates'\n});\n```\n\nSo if your template directory looked like this:\n\n```\nindex.jade\ncontact.jade\nuser/\n    profile.jade\n    info.jade\n```\n\nThen in the browser, you would first need to include the [jade runtime](https://github.com/visionmedia/jade/blob/master/runtime.js) script:\n\n```\nscript(src=\"/static/js/jade-runtime.js\", type=\"text/javascript\")\n```\n\nthen you could reference your templates like so:\n\n```javascript\n$('body').append(Templates['index']());\n$('body').append(Templates['user/profile']({username: 'brad', status: 'fun'}));\n$('body').append(Templates['user/info']());\n```\n### Options\n\n* `url`: The url that should retrieve this resource.\n* `dirname`: Directory where template files are located, will grab them recursively.\n* `separator` (defaults to '/'): The character that separates directories, i like to change it to an underscore, `_`.  So that you get more javascript friendly template names like `Templates.user_profile` or `Templates.friends_interests_list`.\n* `compress` (defaults to false): Whether to minify the javascript or not.\n* `clientVariable` (defaults to 'Templates'): Client side template\nvariable.\n* `hash` (defaults to true): Set to false if you don't want the md5 sum added to your urls.\n\n## AngularTemplatesAsset\n\nThe angular templates asset packages all .html templates ready to be injected into the client side angularjs template cache.\nYou can read more about angularjs [here](http://angularjs.org/).\n\n```javascript\nnew AngularTemplatesAsset({\n    url: '/js/templates.js',\n    directory: __dirname + '/templates'\n});\n```\n\nThen see the following example client js code which loads templates into the template cache, where `angularTemplates` is the function provided by AngularTemplatesAsset:\n\n```javascript\n//replace this with your module initialization logic\nvar myApp = angular.module(\"myApp\", []);\n\n//use this line to add the templates to the cache\nmyApp.run(['$templateCache', angularTemplates]);\n```\n\n### Options\n\n* `url`: The url that should retrieve this resource.\n* `hash` (defaults to true): Set to false if you don't want the md5 sum added to your urls.\n* `directory`: Directory where the .html templates are stored.\n* `compress` (defaults to false): Whether to unglify the js.\n\n## LessAsset\n\nThe less asset basically compiles up and serves your less files as css.  You\ncan read more about less [here](https://github.com/cloudhead/less.js).\n\n```javascript\nnew LessAsset({\n    url: '/style.css',\n    filename: __dirname + '/style/app.less'\n});\n```\n\n### Options\n\n* `url`: The url that should retrieve this resource.\n* `hash` (defaults to true): Set to false if you don't want the md5 sum added to your urls.\n* `filename`: Filename of the less file you want to serve.\n* `compress` (defaults to false): Whether to minify the css.\n* `paths`: List of paths to search for `@import` directives.\n\n\n# License\n\n©2012 Brad Carleton, Tech Pines and available under the [MIT license](http://www.opensource.org/licenses/mit-license.php):\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","readmeFilename":"README.md","_id":"asset-rack@1.1.6","dist":{"shasum":"f1845970eb20b29d7d3cdbc9652bea2a89aaee03","tarball":"https://registry.npmjs.org/asset-rack/-/asset-rack-1.1.6.tgz","integrity":"sha512-SCkYnl/H+goC+lN2p8DtBMMz3+dHzEghTzR/MwPqKPkC+TC12ha4uLBS0xNpM29KFvmDGJzLt7wvfDCQ+dAPZQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEEjqzxnEdAaWM9bmrHD1PVPU4kKjdzR+UDXs71qmXB0AiEA1zt3k6Cb6b2ZHpct5fnCo5rFOP7KkgU66cfiQ4x4QJY="}]},"_npmVersion":"1.1.65","_npmUser":{"name":"brad@techpines.com","email":"brad@techpines.com"},"maintainers":[{"name":"brad@techpines.com","email":"brad@techpines.com"}],"directories":{}},"1.1.7":{"name":"asset-rack","version":"1.1.7","description":"Asset management framework for nodejs","author":{"name":"Brad Carleton","email":"brad@techpines.com"},"repository":{"type":"git","url":"git://github.com/techpines/asset-rack"},"dependencies":{"coffee-script":"1.4.0","browserify":"1.16.6","snockets":"1.3.8","uglify-js":"2.2.2","async":"0.1.22","knox":"0.4.5","less":"1.3.1","jade":"0.27.7","mime":"1.2.7"},"main":"switch.js","engines":{"node":">= 0.5.0"},"readme":"\n![asset-rack!](http://www.techpines.com/static/logo/asset-rack.png)\n\nA node-style asset management framework. Designed for Single Page Apps.\n\nInspired by Trevor Burnham's [connect-assets](https://github.com/TrevorBurnham/connect-assets), and the Rails [Asset Pipeline](http://guides.rubyonrails.org/asset_pipeline.html)\n\n* __Orignal Author__: Brad Carleton\n* __Company__: Tech Pines\n* __Blog Intro__: [Introducing AssetRack](http://www.techpines.com/blog/asset-rack-dynamic-asset-management-nodejs)\n\n## Features\n\n1. Dynamic asset creation for js, css, html templates.\n2. Support for js/coffescript, browserify (node-style requires).\n3. Support for snockets (Rails/Sprockets-style comments to indicate dependencies).\n4. Support for less.\n5. Support for jade templates.\n6. Support for angularjs templates.\n7. Multi-process, multi-server out of the box.  Share nothing.\n8. Filenames hashed for \"forever\" HTML caching and easy CDN updates.\n9. No need to ever compile static files to disk, all-in memory.\n10. Ability to push compiled files to Amazon S3 for use with Cloudfront.\n11. Can be plugged into express as connect middleware.\n12. Easily extensible.\n\n## Install\n\n```bash\nnpm install asset-rack\n```\n\n## Concepts\n\nThere are two very simple conepts to understand with asset-rack.\n\n### Asset\nAn asset after it is `complete`, consists of three very important things.\n* `url`: A human readable url.\n* `contents`: Contents for the asset, like the actual javascript or image or whatever.\n* `md5`: An md5 hash of the contents\n\nThese three pieces are absolutely critical.  The md5 hash is *super* important! This allows us to append our human readable url with the md5 hash for versioning which allows basically every static asset to be cached forever by proxies, browsers, cdn's.  This makes everything fast, fast, fast.\n\n### AssetRack\nAn asset rack is a collection of assets.  But it allows us to do things with assets that we always want to do very easily.  Like serve them from a memory cache using express and connect middleware, or push all individual assets to an Amazon S3 bucket, or write them to disk or whatever other group action we might want to perform on our assets.\n\n## Tutorial\nHere is a simple walk throught that demonstrates some of the\nmajor features of asset rack.\n\n### Create your Assets\nFirst create your assets.  Here we are creating our stylesheets,\njavascript code, and javascript templates from less, coffeescript and jade.\n```javascript\nvar rack = require('asset-rack');\n\nvar assets = new rack.AssetRack([\n    new rack.LessAsset({\n        url: '/style.css',\n        filename: __dirname + '/path/to/file.less'\n    }),\n    new rack.BrowserifyAsset({\n        url: '/app.js',\n        filename: __dirname + '/path/to/app.coffee'\n    }),\n    new rack.JadeAsset({\n        url: '/templates.js',\n        dirname: __dirname + '/templates'\n    })\n]);\n\nassets.on('complete', function() {\n    console.log('hey all my assets were created!');\n});\n```\n\n### Hook into Express\nOnce your assets have been created you can hook them\ninto express with ease.\n```javascript\nassets.on('complete', function() {\n    var app = express.createServer();\n    app.configure(function() {\n        app.use(assets);  // that's all you need to do\n    });\n    app.listen(8000);\n});\n```\n\nAll of those assets are now stored in an in-memroy cache, so it is super fast.\n\n### Markup Functions\n\nIn your jade templates you can include the tags by referencing their url.  For your convenience the assets object will be added to response locals, so that you can do the following in say a jade template:\n\n```\n!= assets.tag('/style.css')\n!= assets.tag('/app.js')\n!= assets.tag('/templates.js')\n```\nWhich results in the following html:\n\n```html\n<link href=\"/style-{md5-sum}.css\" rel=\"stylesheet\"></link>\n<script src=\"/templates-{md5-sum}.js\"></script>\n<script src=\"/app-{md5-sum}.js\"></script>\n```\n\nVery cool, and this will work for multi-process and multi-server.\n\nNotice the md5 sum that is now on the url.  This means you can HTML cache it forever.  Which is exactly what we do if you have the hash option set.  Also, updating your CDN is now a breeze.\n\n### Push Compiled Assets to S3\nNow that all your assets are done and hooked into express you can just\nserve them from your app, but we can do better!  Let's push them to Amazon\nAWS so they can be served by S3 or Cloudfront.\n\n\n```javascript\nassets.on('complete', function() {\n    assets.pushS3({\n        key: '<your aws key>',\n        secret: '<your aws secret>',\n        bucket: '<your aws bucket>'\n    });\n    assets.on('s3-upload-complete', function() {\n        console.log('our assets are now on amazon s3!');\n    });\n});\n```\n\n# API Reference\n\n## AssetRack\n\nThis is your initial collection of assets.\n\n```javascript\nvar assets = new AssetRack([\n    new rack.LessAsset({\n        url: '/style.css',\n        filename: __dirname + '/path/to/file.less'\n    }),\n    new rack.BrowserifyAsset({\n        url: '/app.js',\n        filename: __dirname + '/path/to/app.coffee'\n    }),\n    new rack.JadeAsset({\n        url: '/templates.js',\n        dirname: __dirname + '/templates'\n    })\n]);\n```\n\nTo use with express:\n\n```javascript\napp.use(assets);\n```\n\n### Methods\n* `tag(url)`: Given a url, returns the tag that should be used in HTML.\n* `pushS3({key:key, secret:secret, bucket:bucket})`: Pushes all asset contents to their respective\nurls in an Amazon S3 bucket.\n\n### Events\n\n* `complete`: Emitted after all assets have been created.\n* `s3-upload-complete`: Emitted after assets have been loaded to s3.\n* `error`: Emitted for any errors.\n\n## BrowserifyAsset (js/coffeescript)\n\nBrowserify is an awesome node project that converts node-style requires\nto requirejs for the frontend.  For more details, check it out,\n[here](https://github.com/substack/node-browserify).\n\n```javascript\nnew BrowserifyAsset({\n    url: '/app.js',\n    filename: __dirname + '/client/app.js',\n    compress: true\n});\n```\n\n### Options\n\n* `url`: The url that should retrieve this resource.\n* `filename`: A filename or list of filenames to be executed by the browser.\n* `require`: A filename or list of filenames to require, should not be necessary\nas the `filename` argument should pull in any requires you need.\n* `debug` (defaults to false): enables the browserify debug option.\n* `compress` (defaults to false): whether to run the javascript through a minifier.\n* `extensionHandlers` (defaults to []): an array of custom extensions and associated handler function. eg: `[{ ext: 'handlebars', handler: handlebarsCompilerFunction }]`\n* `hash` (defaults to true): Set to false if you don't want the md5 sum added to your urls.\n\n## Snockets (js/coffeescript)\n\nSnockets is a JavaScript/CoffeeScript concatenation tool for Node.js inspired by Sprockets. Used by connect-assets to create a Rails 3.1-style asset pipeline.  For more details, check it out,\n[here](https://github.com/TrevorBurnham/snockets).\n\n```javascript\nnew SnocketsAsset({\n    url: '/app.js',\n    filename: __dirname + '/client/app.js',\n    compress: true\n});\n```\n\n### Options\n\n* `url`: The url that should retrieve this resource.\n* `filename`: A filename or list of filenames to be executed by the browser.\n* `compress` (defaults to false): whether to run the javascript through a minifier.\n* `extensionHandlers` (defaults to []): an array of custom extensions and associated handler function. eg: `[{ ext: 'handlebars', handler: handlebarsCompilerFunction }]`\n* `debug` (defaults to false): output scripts via eval with trailing //@ sourceURL\n* `hash` (defaults to true): Set to false if you don't want the md5 sum added to your urls.\n\n## JadeAsset\nThis is an awesome asset.  Ever wanted the simplicity of jade templates\non the browser with lightning fast performance.  Here you go.\n\n```javascript\nnew JadeAsset({\n    url: '/templates.js',\n    dirname: __dirname + '/templates'\n});\n```\n\nSo if your template directory looked like this:\n\n```\nindex.jade\ncontact.jade\nuser/\n    profile.jade\n    info.jade\n```\n\nThen in the browser, you would first need to include the [jade runtime](https://github.com/visionmedia/jade/blob/master/runtime.js) script:\n\n```\nscript(src=\"/static/js/jade-runtime.js\", type=\"text/javascript\")\n```\n\nthen you could reference your templates like so:\n\n```javascript\n$('body').append(Templates['index']());\n$('body').append(Templates['user/profile']({username: 'brad', status: 'fun'}));\n$('body').append(Templates['user/info']());\n```\n### Options\n\n* `url`: The url that should retrieve this resource.\n* `dirname`: Directory where template files are located, will grab them recursively.\n* `separator` (defaults to '/'): The character that separates directories, i like to change it to an underscore, `_`.  So that you get more javascript friendly template names like `Templates.user_profile` or `Templates.friends_interests_list`.\n* `compress` (defaults to false): Whether to minify the javascript or not.\n* `clientVariable` (defaults to 'Templates'): Client side template\nvariable.\n* `hash` (defaults to true): Set to false if you don't want the md5 sum added to your urls.\n\n## AngularTemplatesAsset\n\nThe angular templates asset packages all .html templates ready to be injected into the client side angularjs template cache.\nYou can read more about angularjs [here](http://angularjs.org/).\n\n```javascript\nnew AngularTemplatesAsset({\n    url: '/js/templates.js',\n    directory: __dirname + '/templates'\n});\n```\n\nThen see the following example client js code which loads templates into the template cache, where `angularTemplates` is the function provided by AngularTemplatesAsset:\n\n```javascript\n//replace this with your module initialization logic\nvar myApp = angular.module(\"myApp\", []);\n\n//use this line to add the templates to the cache\nmyApp.run(['$templateCache', angularTemplates]);\n```\n\n### Options\n\n* `url`: The url that should retrieve this resource.\n* `hash` (defaults to true): Set to false if you don't want the md5 sum added to your urls.\n* `directory`: Directory where the .html templates are stored.\n* `compress` (defaults to false): Whether to unglify the js.\n\n## LessAsset\n\nThe less asset basically compiles up and serves your less files as css.  You\ncan read more about less [here](https://github.com/cloudhead/less.js).\n\n```javascript\nnew LessAsset({\n    url: '/style.css',\n    filename: __dirname + '/style/app.less'\n});\n```\n\n### Options\n\n* `url`: The url that should retrieve this resource.\n* `hash` (defaults to true): Set to false if you don't want the md5 sum added to your urls.\n* `filename`: Filename of the less file you want to serve.\n* `compress` (defaults to false): Whether to minify the css.\n* `paths`: List of paths to search for `@import` directives.\n\n\n# License\n\n©2012 Brad Carleton, Tech Pines and available under the [MIT license](http://www.opensource.org/licenses/mit-license.php):\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","readmeFilename":"README.md","_id":"asset-rack@1.1.7","dist":{"shasum":"ae43cbb8cbd797f23c2afe30583d40906e22ce65","tarball":"https://registry.npmjs.org/asset-rack/-/asset-rack-1.1.7.tgz","integrity":"sha512-J3aT0QxszbvAbTkuUFvkzCmmKNmQfPoFqyCiARRrdpidlZJx7bHeVCrYJaqz6JAlqsA/5KBqpWQBqOHN9dlMng==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDkKEUsAsHzx1Grj1L7GuEMxCkQYhYILMjgaKbVh96gDAIgWlnUpDI35BgxfUCd1BVNQ4HLDUCSsN0iMWwyNswxZbU="}]},"_npmVersion":"1.1.65","_npmUser":{"name":"brad@techpines.com","email":"brad@techpines.com"},"maintainers":[{"name":"brad@techpines.com","email":"brad@techpines.com"}],"directories":{}},"2.0.1":{"name":"asset-rack","version":"2.0.1","description":"Asset management framework for nodejs","author":{"name":"Brad Carleton","email":"brad@techpines.com"},"repository":{"type":"git","url":"git://github.com/techpines/asset-rack"},"dependencies":{"coffee-script":"1.4.0","browserify":"1.17.3","snockets":"1.3.8","uglify-js":"2.2.4","async":"0.1.22","pkgcloud":"git://github.com/techpines/pkgcloud.git#master","less":"1.3.3","jade":"0.27.7","mime":"1.2.7","nib":"0.9.1","stylus":"0.32.0","underscore":"1.4.4","markdown":"0.4.0"},"devDependencies":{"express.io":"1.1.8","request":"2.12.0","mocha":"1.8.1","chai":"1.4.2"},"scripts":{"test":"cd test; ./test.sh"},"main":"switch.js","engines":{"node":">= 0.5.0"},"readme":"\n<img src=\"https://s3.amazonaws.com/temp.techpines.com/asset-rack-white.png\">\n\n# The Static Web is here\n\nThe Static Web is __blisteringly fast__.  The Static Web is  __ultra efficient__.  The Static Web is __cutting edge__.  And now it has a hero.\n\n```coffeescript\nrack = require 'asset-rack'\n```\n\nThe Static Web is an incredibly modern, high-performance platform for delivering apps and services.  But before you dive-in, you need to start with the basics.  You need to understand the fundamental building block of the static web, the __asset__.\n\n\n## What is an Asset?\n\n> __An asset is a resource on the web that has the following three features:__\n\n1. __Location (URL)__: Where on the web the resource is located.\n2. __Contents (HTTP Response Body)__: The body of the response received by a web client.\n3. __Meta Data (HTTP Headers)__: Gives information about the resource, like content-type, caching info.\n\nThis simple definition is the theoretical bedrock of this entire framework.\n\n## Getting Started\n\nLet's look at a simple example.\n\n```js\nasset = new rack.Asset({\n    url: '/hello.txt',\n    contents: 'hello world'\n})\n```\n\nNeed to serve that asset with a blisteringly fast in memory cache using express?\n\n```\napp.use(asset)\n```\n\n### Hash for speed and efficiency\n\nWhat's cool is that this new asset is available both here:\n\n```\n/hello.txt\n```\n\nAnd here\n\n```\n/hello-5eb63bbbe01eeed093cb22bb8f5acdc3.txt\n```\n\nThat long string of letters and numbers is the md5 hash of the contents.  If you hit the hash url, then we automatically set the HTTP cache to __never expire__.  \n\nNow proxies, browsers, cloud storage, content delivery networks only need to download your asset one single time.  You have versioning, conflict resolution all in one simple mechanism.  You can update your entire entire app instantaneously.  Fast, efficient, static.\n\n### One Rack to rule them All\n\nAssets need to be managed.  Enter the Rack.  A Rack serializes your assets, allows you to deploy to the cloud, and reference urls and tags in your templates.\n\nSay you have a directory structure like this:\n\n```\n/static      # all your images, fonts, etc.\n/style.less  # a less files with your styles\n```\n\nYou can create a Rack to put all your assets in.\n\n```js\nassets = new rack.Rack([\n    new rack.StaticAssets({\n        urlPrefix: '/static'\n        dirname: __dirname + '/static'\n    }),\n    new rack.LessAsset({\n        url: '/style.css'\n        filename: __dirname + '/style.less'\n    }\n])\n```\n\n### Use in your Templates\n\nAfter you hook into express, you can reference your assets in your server side templates.\n\n```js\nassets.tag('/style.css')\n```\n\nWhich gives you the html tag.\n\n```html\n<link href=\"/style-0f2j9fj039fuw0e9f23.css\" rel=\"stylesheet\">\n```\n\nOr you can grab just the url.\n\n```js\nassets.url('/logo.png')\n```\n\nWhich gives the hashed url.\n\n```\n/logo-34t90j0re9g034o4f3o4f3.png\n```\n\n# Batteries Included\n\nWe have some professional grade assets included.\n\n#### For Javascript\n* [Browserify](https://github.com/techpines/asset-rack-new/tree/master/lib#browserify-jscoffeescript) - Create browserify assets that allow you to use \"node-style\" requires on the client-side.\n* [Snockets](https://github.com/techpines/asset-rack-new/tree/master/lib#snockets-jscoffeescript) - Create snockets assets, to get the node-flavor of the \"sprockets\" from rails.\n\n#### For Stylesheets\n* [Less](http://github.com/techpines/asset-rack-new/tree/master/lib#lessasset) - Compile less assets, ability to use dependencies, minification.\n* [Stylus](https://github.com/techpines/asset-rack-new/tree/master/lib#stylusasset) - Compile stylu assets, ability to use dependencies, minification.\n\n#### Templates\n* [Jade](https://github.com/techpines/asset-rack-new/tree/master/lib#jadeasset) - High, performance jade templates precompiled for the browser.\n* [AngularTemplates](https://github.com/techpines/asset-rack-new/tree/master/lib#angulartemplatesasset) - AngularJS templates for you AngularJS folks.\n\n#### Static\n* [StaticAssets](https://github.com/techpines/asset-rack-new/tree/master/lib#staticassets) - Images(png, jpg, gif), fonts, whatever you got.\n\n## Roll your own\n\nAsset Rack is extremely flexible.  Extend the __Asset__ class and override the __create__ method to roll your own awesomeness, and watch them get automatically ka-pow'ed by your rack.\n\n```js\nSuperCoolAsset = rack.Asset.extend({\n    create: function(options) {\n        this.contents = 'easy, easy'\n        this.emit 'created'\n    }\n})\n```\nOr, for those with more refined taste:\n\n```coffee\nclass SuperCoolAsset extends rack.Asset\n    create: (options) ->\n        @contents = 'even easier with coffee'\n        @emit 'created'\n```\n\nCheckout the [tutorial.](https://github.com/techpines/asset-rack-new/tree/master/lib#extending-the-asset-class)\n\n\n## Deploying to the Cloud\nYour assets need to be deployed! Here are the current providers that are supported.\n\n### Amazon S3\n\n```js\nassets.deploy({\n    provider: 'amazon',\n    container: 'some-bucket',\n    accessKey: 'aws-access-key',\n    secretKey: 'aws-secret-key',\n}, function(error) {})\n```\n\n### Rackspace Cloud Files\n```js\nassets.deploy(\n    provider: 'rackspace',\n    container: 'some-container',\n    username: 'rackspace-username',\n    apiKey: 'rackspace-api-key',\n}, function(error) {})\n```\n\n### Azure Storage\n```js\nassets.deploy(\n    provider: 'azure',\n    container: 'some-container',\n    storageAccount: 'test-storage-account',\n    storageAccessKey: 'test-storage-access-key'\n}, function(error) {})\n```\n\n\n## FAQ\n\n#### __Why is this better than Connect-Assets?__\n\nThat's easy!\n\n* It works with node.js multi-process and cluster.\n* More built-in assets.\n* Un-opionated, connect-assets dictates your url structure AND directory structure.\n* Ability to deploy to the cloud.\n* Easy to extend.\n* Simpler to use.\n\nWith all that said, much thanks to Trevor for writing connect-assets. \n\n#### __Why is this better than Grunt?__\n\nGrunt is a great build tool.  Asset Rack is not a build a tool.  It never writes files to disk, there is no \"build step\".  Everything happens \"just in time\".\n\nIf you have \"genuine\" build issues, then by all means use Grunt.  You can even use Grunt with Asset Rack.\n\nHowever, if you are only using Grunt to manage your static assets, then you should consider upgrading to Asset Rack.\n\n#### __Why is this better than Wintersmith(Blacksmith)?__\n\nAsset Rack is a static web framework, and at it's core there are only two abstractions, the `Asset` and `Rack` classes.  Wintersmith is a high level framework that solves a more specific problem.\n\nWintersmith could consume Asset Rack as a dependency, and if something more high-level fits your specific use case, then by all means that is probably a good fit.  If you need more flexibilty and power, then go with Asset Rack.\n\n# License\n\n©2012 Brad Carleton, Tech Pines and available under the [MIT license](http://www.opensource.org/licenses/mit-license.php):\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","readmeFilename":"README.md","_id":"asset-rack@2.0.1","dist":{"shasum":"1e50a56227951f618e6127c6f6a9ce9cf483f895","tarball":"https://registry.npmjs.org/asset-rack/-/asset-rack-2.0.1.tgz","integrity":"sha512-DXhk2d5IYOHWJEGmo8WBSG7ZV16Rsumu0/vpzJHCpZ9YqruB8vUxrfitva8BubwUIPdrCDfrAQ5hhSfFNHifmw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDVIA9ztG98TnR6gjfgemMdOiKmfO0YVZ2mP4RbP+O07wIgaEVu8PjfodkbG2aXgCH8dfVS7d/Xo/W81CgfQtdF6cs="}]},"_npmVersion":"1.1.65","_npmUser":{"name":"brad@techpines.com","email":"brad@techpines.com"},"maintainers":[{"name":"brad@techpines.com","email":"brad@techpines.com"}],"directories":{}},"2.0.2":{"name":"asset-rack","version":"2.0.2","description":"Asset management framework for nodejs","author":{"name":"Brad Carleton","email":"brad@techpines.com"},"repository":{"type":"git","url":"git://github.com/techpines/asset-rack"},"dependencies":{"coffee-script":"1.4.0","browserify":"1.17.3","snockets":"1.3.8","uglify-js":"2.2.4","async":"0.1.22","pkgcloud":"git://github.com/techpines/pkgcloud.git#master","less":"1.3.3","jade":"0.27.7","mime":"1.2.7","nib":"0.9.1","stylus":"0.32.0","underscore":"1.4.4","markdown":"0.4.0"},"devDependencies":{"express.io":"1.1.8","request":"2.12.0","mocha":"1.8.1","chai":"1.4.2"},"scripts":{"test":"cd test; ./test.sh"},"main":"switch.js","engines":{"node":">= 0.5.0"},"readme":"\n<img src=\"https://s3.amazonaws.com/temp.techpines.com/asset-rack-white.png\">\n\n# The Static Web is here\n\nThe Static Web is __blisteringly fast__.  The Static Web is  __ultra efficient__.  The Static Web is __cutting edge__.  And now it has a hero.\n\n```coffeescript\nrack = require 'asset-rack'\n```\n\nThe Static Web is an incredibly modern, high-performance platform for delivering apps and services.  But before you dive-in, you need to start with the basics.  You need to understand the fundamental building block of the static web, the __asset__.\n\n\n## What is an Asset?\n\n> __An asset is a resource on the web that has the following three features:__\n\n1. __Location (URL)__: Where on the web the resource is located.\n2. __Contents (HTTP Response Body)__: The body of the response received by a web client.\n3. __Meta Data (HTTP Headers)__: Gives information about the resource, like content-type, caching info.\n\nThis simple definition is the theoretical bedrock of this entire framework.\n\n## Getting Started\n\nLet's look at a simple example.\n\n```js\nasset = new rack.Asset({\n    url: '/hello.txt',\n    contents: 'hello world'\n})\n```\n\nNeed to serve that asset with a blisteringly fast in memory cache using express?\n\n```\napp.use(asset)\n```\n\n### Hash for speed and efficiency\n\nWhat's cool is that this new asset is available both here:\n\n```\n/hello.txt\n```\n\nAnd here\n\n```\n/hello-5eb63bbbe01eeed093cb22bb8f5acdc3.txt\n```\n\nThat long string of letters and numbers is the md5 hash of the contents.  If you hit the hash url, then we automatically set the HTTP cache to __never expire__.  \n\nNow proxies, browsers, cloud storage, content delivery networks only need to download your asset one single time.  You have versioning, conflict resolution all in one simple mechanism.  You can update your entire entire app instantaneously.  Fast, efficient, static.\n\n### One Rack to rule them All\n\nAssets need to be managed.  Enter the Rack.  A Rack serializes your assets, allows you to deploy to the cloud, and reference urls and tags in your templates.\n\nSay you have a directory structure like this:\n\n```\n/static      # all your images, fonts, etc.\n/style.less  # a less files with your styles\n```\n\nYou can create a Rack to put all your assets in.\n\n```js\nassets = new rack.Rack([\n    new rack.StaticAssets({\n        urlPrefix: '/static'\n        dirname: __dirname + '/static'\n    }),\n    new rack.LessAsset({\n        url: '/style.css'\n        filename: __dirname + '/style.less'\n    }\n])\n```\n\n### Use in your Templates\n\nAfter you hook into express, you can reference your assets in your server side templates.\n\n```js\nassets.tag('/style.css')\n```\n\nWhich gives you the html tag.\n\n```html\n<link href=\"/style-0f2j9fj039fuw0e9f23.css\" rel=\"stylesheet\">\n```\n\nOr you can grab just the url.\n\n```js\nassets.url('/logo.png')\n```\n\nWhich gives the hashed url.\n\n```\n/logo-34t90j0re9g034o4f3o4f3.png\n```\n\n# Batteries Included\n\nWe have some professional grade assets included.\n\n#### For Javascript\n* [Browserify](https://github.com/techpines/asset-rack-new/tree/master/lib#browserify-jscoffeescript) - Create browserify assets that allow you to use \"node-style\" requires on the client-side.\n* [Snockets](https://github.com/techpines/asset-rack-new/tree/master/lib#snockets-jscoffeescript) - Create snockets assets, to get the node-flavor of the \"sprockets\" from rails.\n\n#### For Stylesheets\n* [Less](http://github.com/techpines/asset-rack-new/tree/master/lib#lessasset) - Compile less assets, ability to use dependencies, minification.\n* [Stylus](https://github.com/techpines/asset-rack-new/tree/master/lib#stylusasset) - Compile stylu assets, ability to use dependencies, minification.\n\n#### Templates\n* [Jade](https://github.com/techpines/asset-rack-new/tree/master/lib#jadeasset) - High, performance jade templates precompiled for the browser.\n* [AngularTemplates](https://github.com/techpines/asset-rack-new/tree/master/lib#angulartemplatesasset) - AngularJS templates for you AngularJS folks.\n\n#### Static\n* [StaticAssets](https://github.com/techpines/asset-rack-new/tree/master/lib#staticassets) - Images(png, jpg, gif), fonts, whatever you got.\n\n## Roll your own\n\nAsset Rack is extremely flexible.  Extend the __Asset__ class and override the __create__ method to roll your own awesomeness, and watch them get automatically ka-pow'ed by your rack.\n\n```js\nSuperCoolAsset = rack.Asset.extend({\n    create: function(options) {\n        this.contents = 'easy, easy'\n        this.emit 'created'\n    }\n})\n```\nOr, for those with more refined taste:\n\n```coffee\nclass SuperCoolAsset extends rack.Asset\n    create: (options) ->\n        @contents = 'even easier with coffee'\n        @emit 'created'\n```\n\nCheckout the [tutorial.](https://github.com/techpines/asset-rack-new/tree/master/lib#extending-the-asset-class)\n\n\n## Deploying to the Cloud\nYour assets need to be deployed! Here are the current providers that are supported.\n\n### Amazon S3\n\n```js\nassets.deploy({\n    provider: 'amazon',\n    container: 'some-bucket',\n    accessKey: 'aws-access-key',\n    secretKey: 'aws-secret-key',\n}, function(error) {})\n```\n\n### Rackspace Cloud Files\n```js\nassets.deploy(\n    provider: 'rackspace',\n    container: 'some-container',\n    username: 'rackspace-username',\n    apiKey: 'rackspace-api-key',\n}, function(error) {})\n```\n\n### Azure Storage\n```js\nassets.deploy(\n    provider: 'azure',\n    container: 'some-container',\n    storageAccount: 'test-storage-account',\n    storageAccessKey: 'test-storage-access-key'\n}, function(error) {})\n```\n\n\n## FAQ\n\n#### __Why is this better than Connect-Assets?__\n\nThat's easy!\n\n* It works with node.js multi-process and cluster.\n* More built-in assets.\n* Un-opionated, connect-assets dictates your url structure AND directory structure.\n* Ability to deploy to the cloud.\n* Easy to extend.\n* Simpler to use.\n\nWith all that said, much thanks to Trevor for writing connect-assets. \n\n#### __Why is this better than Grunt?__\n\nGrunt is a great build tool.  Asset Rack is not a build a tool.  It never writes files to disk, there is no \"build step\".  Everything happens \"just in time\".\n\nIf you have \"genuine\" build issues, then by all means use Grunt.  You can even use Grunt with Asset Rack.\n\nHowever, if you are only using Grunt to manage your static assets, then you should consider upgrading to Asset Rack.\n\n#### __Why is this better than Wintersmith(Blacksmith)?__\n\nAsset Rack is a static web framework, and at it's core there are only two abstractions, the `Asset` and `Rack` classes.  Wintersmith is a high level framework that solves a more specific problem.\n\nWintersmith could consume Asset Rack as a dependency, and if something more high-level fits your specific use case, then by all means that is probably a good fit.  If you need more flexibilty and power, then go with Asset Rack.\n\n# License\n\n©2012 Brad Carleton, Tech Pines and available under the [MIT license](http://www.opensource.org/licenses/mit-license.php):\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","readmeFilename":"README.md","_id":"asset-rack@2.0.2","dist":{"shasum":"45d3bc1b379988fcef8549d987ae08bf013a4768","tarball":"https://registry.npmjs.org/asset-rack/-/asset-rack-2.0.2.tgz","integrity":"sha512-8ZhkgMPDtVtj82GCoS/TDufO4nge1glzaPKRbDXBX1aGjX1TB0gJTm+/aqnt+YfHltF9GubuuBVxE++9kQ1RzQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCBO5u7u3XvRLpJvGua0vvI2IlHhtNCZKjECEbGepqOxAIhAKHij5WPsVdJ/3q+nQ1pXXN3x7T+ugDphoqGEu9hOXir"}]},"_npmVersion":"1.1.65","_npmUser":{"name":"brad@techpines.com","email":"brad@techpines.com"},"maintainers":[{"name":"brad@techpines.com","email":"brad@techpines.com"}],"directories":{}},"2.0.3":{"name":"asset-rack","version":"2.0.3","description":"Asset management framework for nodejs","author":{"name":"Brad Carleton","email":"brad@techpines.com"},"repository":{"type":"git","url":"https://github.com/techpines/asset-rack"},"dependencies":{"coffee-script":"1.4.0","browserify":"1.17.3","snockets":"1.3.8","uglify-js":"2.2.4","async":"0.1.22","pkgcloud":"0.6.6","less":"1.3.3","jade":"0.27.7","mime":"1.2.7","nib":"0.9.1","stylus":"0.32.0","underscore":"1.4.4","markdown":"0.4.0"},"devDependencies":{"express.io":"1.1.8","request":"2.12.0","mocha":"1.8.1","chai":"1.4.2"},"scripts":{"test":"cd test; ./test.sh"},"main":"switch.js","engines":{"node":">= 0.5.0"},"readme":"\n<img src=\"https://s3.amazonaws.com/temp.techpines.com/asset-rack-white.png\">\n\n# The Static Web is here\n\nThe Static Web is __blisteringly fast__.  The Static Web is  __ultra efficient__.  The Static Web is __cutting edge__.  And now it has a hero.\n\n```coffeescript\nrack = require 'asset-rack'\n```\n\nThe Static Web is an incredibly modern, high-performance platform for delivering apps and services.  But before you dive-in, you need to start with the basics.  You need to understand the fundamental building block of the static web, the __asset__.\n\n\n## What is an Asset?\n\n> __An asset is a resource on the web that has the following three features:__\n\n1. __Location (URL)__: Where on the web the resource is located.\n2. __Contents (HTTP Response Body)__: The body of the response received by a web client.\n3. __Meta Data (HTTP Headers)__: Gives information about the resource, like content-type, caching info.\n\nThis simple definition is the theoretical bedrock of this entire framework.\n\n## Getting Started\n\nLet's look at a simple example.\n\n```js\nasset = new rack.Asset({\n    url: '/hello.txt',\n    contents: 'hello world'\n})\n```\n\nNeed to serve that asset with a blisteringly fast in memory cache using express?\n\n```\napp.use(asset)\n```\n\n### Hash for speed and efficiency\n\nWhat's cool is that this new asset is available both here:\n\n```\n/hello.txt\n```\n\nAnd here\n\n```\n/hello-5eb63bbbe01eeed093cb22bb8f5acdc3.txt\n```\n\nThat long string of letters and numbers is the md5 hash of the contents.  If you hit the hash url, then we automatically set the HTTP cache to __never expire__.  \n\nNow proxies, browsers, cloud storage, content delivery networks only need to download your asset one single time.  You have versioning, conflict resolution all in one simple mechanism.  You can update your entire entire app instantaneously.  Fast, efficient, static.\n\n### One Rack to rule them All\n\nAssets need to be managed.  Enter the Rack.  A Rack serializes your assets, allows you to deploy to the cloud, and reference urls and tags in your templates.\n\nSay you have a directory structure like this:\n\n```\n/static      # all your images, fonts, etc.\n/style.less  # a less files with your styles\n```\n\nYou can create a Rack to put all your assets in.\n\n```js\nassets = new rack.Rack([\n    new rack.StaticAssets({\n        urlPrefix: '/static'\n        dirname: __dirname + '/static'\n    }),\n    new rack.LessAsset({\n        url: '/style.css'\n        filename: __dirname + '/style.less'\n    }\n])\n```\n\n### Use in your Templates\n\nAfter you hook into express, you can reference your assets in your server side templates.\n\n```js\nassets.tag('/style.css')\n```\n\nWhich gives you the html tag.\n\n```html\n<link href=\"/style-0f2j9fj039fuw0e9f23.css\" rel=\"stylesheet\">\n```\n\nOr you can grab just the url.\n\n```js\nassets.url('/logo.png')\n```\n\nWhich gives the hashed url.\n\n```\n/logo-34t90j0re9g034o4f3o4f3.png\n```\n\n# Batteries Included\n\nWe have some professional grade assets included.\n\n#### For Javascript\n* [Browserify](https://github.com/techpines/asset-rack-new/tree/master/lib#browserify-jscoffeescript) - Create browserify assets that allow you to use \"node-style\" requires on the client-side.\n* [Snockets](https://github.com/techpines/asset-rack-new/tree/master/lib#snockets-jscoffeescript) - Create snockets assets, to get the node-flavor of the \"sprockets\" from rails.\n\n#### For Stylesheets\n* [Less](http://github.com/techpines/asset-rack-new/tree/master/lib#lessasset) - Compile less assets, ability to use dependencies, minification.\n* [Stylus](https://github.com/techpines/asset-rack-new/tree/master/lib#stylusasset) - Compile stylu assets, ability to use dependencies, minification.\n\n#### Templates\n* [Jade](https://github.com/techpines/asset-rack-new/tree/master/lib#jadeasset) - High, performance jade templates precompiled for the browser.\n* [AngularTemplates](https://github.com/techpines/asset-rack-new/tree/master/lib#angulartemplatesasset) - AngularJS templates for you AngularJS folks.\n\n#### Static\n* [StaticAssets](https://github.com/techpines/asset-rack-new/tree/master/lib#staticassets) - Images(png, jpg, gif), fonts, whatever you got.\n\n## Roll your own\n\nAsset Rack is extremely flexible.  Extend the __Asset__ class and override the __create__ method to roll your own awesomeness, and watch them get automatically ka-pow'ed by your rack.\n\n```js\nSuperCoolAsset = rack.Asset.extend({\n    create: function(options) {\n        this.contents = 'easy, easy'\n        this.emit 'created'\n    }\n})\n```\nOr, for those with more refined taste:\n\n```coffee\nclass SuperCoolAsset extends rack.Asset\n    create: (options) ->\n        @contents = 'even easier with coffee'\n        @emit 'created'\n```\n\nCheckout the [tutorial.](https://github.com/techpines/asset-rack-new/tree/master/lib#extending-the-asset-class)\n\n\n## Deploying to the Cloud\nYour assets need to be deployed! Here are the current providers that are supported.\n\n### Amazon S3\n\n```js\nassets.deploy({\n    provider: 'amazon',\n    container: 'some-bucket',\n    accessKey: 'aws-access-key',\n    secretKey: 'aws-secret-key',\n}, function(error) {})\n```\n\n### Rackspace Cloud Files\n```js\nassets.deploy(\n    provider: 'rackspace',\n    container: 'some-container',\n    username: 'rackspace-username',\n    apiKey: 'rackspace-api-key',\n}, function(error) {})\n```\n\n### Azure Storage\n```js\nassets.deploy(\n    provider: 'azure',\n    container: 'some-container',\n    storageAccount: 'test-storage-account',\n    storageAccessKey: 'test-storage-access-key'\n}, function(error) {})\n```\n\n\n## FAQ\n\n#### __Why is this better than Connect-Assets?__\n\nThat's easy!\n\n* It works with node.js multi-process and cluster.\n* More built-in assets.\n* Un-opionated, connect-assets dictates your url structure AND directory structure.\n* Ability to deploy to the cloud.\n* Easy to extend.\n* Simpler to use.\n\nWith all that said, much thanks to Trevor for writing connect-assets. \n\n#### __Why is this better than Grunt?__\n\nGrunt is a great build tool.  Asset Rack is not a build a tool.  It never writes files to disk, there is no \"build step\".  Everything happens \"just in time\".\n\nIf you have \"genuine\" build issues, then by all means use Grunt.  You can even use Grunt with Asset Rack.\n\nHowever, if you are only using Grunt to manage your static assets, then you should consider upgrading to Asset Rack.\n\n#### __Why is this better than Wintersmith(Blacksmith)?__\n\nAsset Rack is a static web framework, and at it's core there are only two abstractions, the `Asset` and `Rack` classes.  Wintersmith is a high level framework that solves a more specific problem.\n\nWintersmith could consume Asset Rack as a dependency, and if something more high-level fits your specific use case, then by all means that is probably a good fit.  If you need more flexibilty and power, then go with Asset Rack.\n\n# License\n\n©2012 Brad Carleton, Tech Pines and available under the [MIT license](http://www.opensource.org/licenses/mit-license.php):\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","readmeFilename":"README.md","_id":"asset-rack@2.0.3","dist":{"shasum":"36d3d7df643c2af2cc6a3e6c384300c4326564b3","tarball":"https://registry.npmjs.org/asset-rack/-/asset-rack-2.0.3.tgz","integrity":"sha512-FJraicVLRRXZE5ycHh6dLNrjzY6eFFg0JDctVJwhfiTBWh501SyiRUu3KM8JQajA+aKSTwgZVSzT8K8KfFoMyw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCZwkNtsW6IL+1uFtzQ68gvkg0zK2IAWj6yQoMm/qESGgIhAP8qK4FUnJiQWWdDsFlMn8gLrguFnDDp1aep1KQ5SZGO"}]},"_npmVersion":"1.1.65","_npmUser":{"name":"brad@techpines.com","email":"brad@techpines.com"},"maintainers":[{"name":"brad@techpines.com","email":"brad@techpines.com"}],"directories":{}},"2.0.4":{"name":"asset-rack","version":"2.0.4","description":"Asset management framework for nodejs","author":{"name":"Brad Carleton","email":"brad@techpines.com"},"repository":{"type":"git","url":"https://github.com/techpines/asset-rack"},"dependencies":{"coffee-script":"1.4.0","browserify":"1.17.3","snockets":"1.3.8","uglify-js":"2.2.4","async":"0.1.22","pkgcloud":"0.6.6","less":"1.3.3","jade":"0.27.7","mime":"1.2.7","nib":"0.9.1","stylus":"0.32.0","underscore":"1.4.4","markdown":"0.4.0"},"devDependencies":{"express.io":"1.1.8","request":"2.12.0","mocha":"1.8.1","chai":"1.4.2"},"scripts":{"test":"cd test; ./test.sh"},"main":"switch.js","engines":{"node":">= 0.5.0"},"readme":"\n<img src=\"https://s3.amazonaws.com/temp.techpines.com/asset-rack-white.png\">\n\n# The Static Web is here\n\nThe Static Web is __blisteringly fast__.  The Static Web is  __ultra efficient__.  The Static Web is __cutting edge__.  And now it has a hero.\n\n```coffeescript\nrack = require 'asset-rack'\n```\n\nThe Static Web is an incredibly modern, high-performance platform for delivering apps and services.  But before you dive-in, you need to start with the basics.  You need to understand the fundamental building block of the static web, the __asset__.\n\n\n## What is an Asset?\n\n> __An asset is a resource on the web that has the following three features:__\n\n1. __Location (URL)__: Where on the web the resource is located.\n2. __Contents (HTTP Response Body)__: The body of the response received by a web client.\n3. __Meta Data (HTTP Headers)__: Gives information about the resource, like content-type, caching info.\n\nThis simple definition is the theoretical bedrock of this entire framework.\n\n## Getting Started\n\nLet's look at a simple example.\n\n```js\nasset = new rack.Asset({\n    url: '/hello.txt',\n    contents: 'hello world'\n})\n```\n\nNeed to serve that asset with a blisteringly fast in memory cache using express?\n\n```\napp.use(asset)\n```\n\n### Hash for speed and efficiency\n\nWhat's cool is that this new asset is available both here:\n\n```\n/hello.txt\n```\n\nAnd here\n\n```\n/hello-5eb63bbbe01eeed093cb22bb8f5acdc3.txt\n```\n\nThat long string of letters and numbers is the md5 hash of the contents.  If you hit the hash url, then we automatically set the HTTP cache to __never expire__.  \n\nNow proxies, browsers, cloud storage, content delivery networks only need to download your asset one single time.  You have versioning, conflict resolution all in one simple mechanism.  You can update your entire entire app instantaneously.  Fast, efficient, static.\n\n### One Rack to rule them All\n\nAssets need to be managed.  Enter the Rack.  A Rack serializes your assets, allows you to deploy to the cloud, and reference urls and tags in your templates.\n\nSay you have a directory structure like this:\n\n```\n/static      # all your images, fonts, etc.\n/style.less  # a less files with your styles\n```\n\nYou can create a Rack to put all your assets in.\n\n```js\nassets = new rack.Rack([\n    new rack.StaticAssets({\n        urlPrefix: '/static'\n        dirname: __dirname + '/static'\n    }),\n    new rack.LessAsset({\n        url: '/style.css'\n        filename: __dirname + '/style.less'\n    }\n])\n```\n\n### Use in your Templates\n\nAfter you hook into express, you can reference your assets in your server side templates.\n\n```js\nassets.tag('/style.css')\n```\n\nWhich gives you the html tag.\n\n```html\n<link href=\"/style-0f2j9fj039fuw0e9f23.css\" rel=\"stylesheet\">\n```\n\nOr you can grab just the url.\n\n```js\nassets.url('/logo.png')\n```\n\nWhich gives the hashed url.\n\n```\n/logo-34t90j0re9g034o4f3o4f3.png\n```\n\n# Batteries Included\n\nWe have some professional grade assets included.\n\n#### For Javascript\n* [Browserify](https://github.com/techpines/asset-rack-new/tree/master/lib#browserify-jscoffeescript) - Create browserify assets that allow you to use \"node-style\" requires on the client-side.\n* [Snockets](https://github.com/techpines/asset-rack-new/tree/master/lib#snockets-jscoffeescript) - Create snockets assets, to get the node-flavor of the \"sprockets\" from rails.\n\n#### For Stylesheets\n* [Less](http://github.com/techpines/asset-rack-new/tree/master/lib#lessasset) - Compile less assets, ability to use dependencies, minification.\n* [Stylus](https://github.com/techpines/asset-rack-new/tree/master/lib#stylusasset) - Compile stylu assets, ability to use dependencies, minification.\n\n#### Templates\n* [Jade](https://github.com/techpines/asset-rack-new/tree/master/lib#jadeasset) - High, performance jade templates precompiled for the browser.\n* [AngularTemplates](https://github.com/techpines/asset-rack-new/tree/master/lib#angulartemplatesasset) - AngularJS templates for you AngularJS folks.\n\n#### Static\n* [StaticAssets](https://github.com/techpines/asset-rack-new/tree/master/lib#staticassets) - Images(png, jpg, gif), fonts, whatever you got.\n\n## Roll your own\n\nAsset Rack is extremely flexible.  Extend the __Asset__ class and override the __create__ method to roll your own awesomeness, and watch them get automatically ka-pow'ed by your rack.\n\n```js\nSuperCoolAsset = rack.Asset.extend({\n    create: function(options) {\n        this.contents = 'easy, easy'\n        this.emit 'created'\n    }\n})\n```\nOr, for those with more refined taste:\n\n```coffee\nclass SuperCoolAsset extends rack.Asset\n    create: (options) ->\n        @contents = 'even easier with coffee'\n        @emit 'created'\n```\n\nCheckout the [tutorial.](https://github.com/techpines/asset-rack-new/tree/master/lib#extending-the-asset-class)\n\n\n## Deploying to the Cloud\nYour assets need to be deployed! Here are the current providers that are supported.\n\n### Amazon S3\n\n```js\nassets.deploy({\n    provider: 'amazon',\n    container: 'some-bucket',\n    accessKey: 'aws-access-key',\n    secretKey: 'aws-secret-key',\n}, function(error) {})\n```\n\n### Rackspace Cloud Files\n```js\nassets.deploy(\n    provider: 'rackspace',\n    container: 'some-container',\n    username: 'rackspace-username',\n    apiKey: 'rackspace-api-key',\n}, function(error) {})\n```\n\n### Azure Storage\n```js\nassets.deploy(\n    provider: 'azure',\n    container: 'some-container',\n    storageAccount: 'test-storage-account',\n    storageAccessKey: 'test-storage-access-key'\n}, function(error) {})\n```\n\n\n## FAQ\n\n#### __Why is this better than Connect-Assets?__\n\nThat's easy!\n\n* It works with node.js multi-process and cluster.\n* More built-in assets.\n* Un-opionated, connect-assets dictates your url structure AND directory structure.\n* Ability to deploy to the cloud.\n* Easy to extend.\n* Simpler to use.\n\nWith all that said, much thanks to Trevor for writing connect-assets. \n\n#### __Why is this better than Grunt?__\n\nGrunt is a great build tool.  Asset Rack is not a build a tool.  It never writes files to disk, there is no \"build step\".  Everything happens \"just in time\".\n\nIf you have \"genuine\" build issues, then by all means use Grunt.  You can even use Grunt with Asset Rack.\n\nHowever, if you are only using Grunt to manage your static assets, then you should consider upgrading to Asset Rack.\n\n#### __Why is this better than Wintersmith(Blacksmith)?__\n\nAsset Rack is a static web framework, and at it's core there are only two abstractions, the `Asset` and `Rack` classes.  Wintersmith is a high level framework that solves a more specific problem.\n\nWintersmith could consume Asset Rack as a dependency, and if something more high-level fits your specific use case, then by all means that is probably a good fit.  If you need more flexibilty and power, then go with Asset Rack.\n\n# License\n\n©2012 Brad Carleton, Tech Pines and available under the [MIT license](http://www.opensource.org/licenses/mit-license.php):\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","readmeFilename":"README.md","_id":"asset-rack@2.0.4","dist":{"shasum":"56abe2c390137ed3bbbdc0e26b7e8ecfc6d80d67","tarball":"https://registry.npmjs.org/asset-rack/-/asset-rack-2.0.4.tgz","integrity":"sha512-etmjLDphjAXrVTYdw+qndAldN7JeH+661jWG8kP5EJXrk2LwVE3sdeZmTnFCIeOKC2rfGrXdbdZv0USRTGYEAw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCkv+en8rzMc6v13+Uu+UP+UyhjoaI3FiH22jQRvQ8oKgIhAPk0t0MrFC2PkvLVAZpvD4Xlu4za4lUzynPMlJAtAySo"}]},"_npmVersion":"1.1.65","_npmUser":{"name":"brad@techpines.com","email":"brad@techpines.com"},"maintainers":[{"name":"brad@techpines.com","email":"brad@techpines.com"}],"directories":{}},"2.0.5":{"name":"asset-rack","version":"2.0.5","description":"Asset management framework for nodejs","author":{"name":"Brad Carleton","email":"brad@techpines.com"},"repository":{"type":"git","url":"https://github.com/techpines/asset-rack"},"dependencies":{"coffee-script":"1.4.0","browserify":"1.17.3","snockets":"1.3.8","uglify-js":"2.2.4","async":"0.1.22","pkgcloud":"0.6.6","less":"1.3.3","jade":"0.27.7","mime":"1.2.7","nib":"0.9.1","stylus":"0.32.0","underscore":"1.4.4","markdown":"0.4.0"},"devDependencies":{"express.io":"1.1.8","request":"2.12.0","mocha":"1.8.1","chai":"1.4.2"},"scripts":{"test":"mocha --compilers coffee:coffee-script test/test.coffee --reporter spec --timeout 5000 --ignore-leaks"},"main":"switch.js","engines":{"node":">= 0.5.0"},"readme":"\n<img src=\"https://s3.amazonaws.com/temp.techpines.com/asset-rack-white.png\">\n\n# The Static Web is here\n\nThe Static Web is __blisteringly fast__.  The Static Web is  __ultra efficient__.  The Static Web is __cutting edge__.  And now it has a hero.\n\n```coffeescript\nrack = require 'asset-rack'\n```\n\nThe Static Web is an incredibly modern, high-performance platform for delivering apps and services.  But before you dive-in, you need to start with the basics.  You need to understand the fundamental building block of the static web, the __asset__.\n\n\n## What is an Asset?\n\n> __An asset is a resource on the web that has the following three features:__\n\n1. __Location (URL)__: Where on the web the resource is located.\n2. __Contents (HTTP Response Body)__: The body of the response received by a web client.\n3. __Meta Data (HTTP Headers)__: Gives information about the resource, like content-type, caching info.\n\nThis simple definition is the theoretical bedrock of this entire framework.\n\n## Getting Started\n\nLet's look at a simple example.\n\n```js\nasset = new rack.Asset({\n    url: '/hello.txt',\n    contents: 'hello world'\n})\n```\n\nNeed to serve that asset with a blisteringly fast in memory cache using express?\n\n```\napp.use(asset)\n```\n\n### Hash for speed and efficiency\n\nWhat's cool is that this new asset is available both here:\n\n```\n/hello.txt\n```\n\nAnd here\n\n```\n/hello-5eb63bbbe01eeed093cb22bb8f5acdc3.txt\n```\n\nThat long string of letters and numbers is the md5 hash of the contents.  If you hit the hash url, then we automatically set the HTTP cache to __never expire__.  \n\nNow proxies, browsers, cloud storage, content delivery networks only need to download your asset one single time.  You have versioning, conflict resolution all in one simple mechanism.  You can update your entire entire app instantaneously.  Fast, efficient, static.\n\n### One Rack to rule them All\n\nAssets need to be managed.  Enter the Rack.  A Rack serializes your assets, allows you to deploy to the cloud, and reference urls and tags in your templates.\n\nSay you have a directory structure like this:\n\n```\n/static      # all your images, fonts, etc.\n/style.less  # a less files with your styles\n```\n\nYou can create a Rack to put all your assets in.\n\n```js\nassets = new rack.Rack([\n    new rack.StaticAssets({\n        urlPrefix: '/static'\n        dirname: __dirname + '/static'\n    }),\n    new rack.LessAsset({\n        url: '/style.css'\n        filename: __dirname + '/style.less'\n    }\n])\n```\n\n### Use in your Templates\n\nAfter you hook into express, you can reference your assets in your server side templates.\n\n```js\nassets.tag('/style.css')\n```\n\nWhich gives you the html tag.\n\n```html\n<link href=\"/style-0f2j9fj039fuw0e9f23.css\" rel=\"stylesheet\">\n```\n\nOr you can grab just the url.\n\n```js\nassets.url('/logo.png')\n```\n\nWhich gives the hashed url.\n\n```\n/logo-34t90j0re9g034o4f3o4f3.png\n```\n\n# Batteries Included\n\nWe have some professional grade assets included.\n\n#### For Javascript\n* [Browserify](https://github.com/techpines/asset-rack-new/tree/master/lib#browserify-jscoffeescript) - Create browserify assets that allow you to use \"node-style\" requires on the client-side.\n* [Snockets](https://github.com/techpines/asset-rack-new/tree/master/lib#snockets-jscoffeescript) - Create snockets assets, to get the node-flavor of the \"sprockets\" from rails.\n\n#### For Stylesheets\n* [Less](http://github.com/techpines/asset-rack-new/tree/master/lib#lessasset) - Compile less assets, ability to use dependencies, minification.\n* [Stylus](https://github.com/techpines/asset-rack-new/tree/master/lib#stylusasset) - Compile stylu assets, ability to use dependencies, minification.\n\n#### Templates\n* [Jade](https://github.com/techpines/asset-rack-new/tree/master/lib#jadeasset) - High, performance jade templates precompiled for the browser.\n* [AngularTemplates](https://github.com/techpines/asset-rack-new/tree/master/lib#angulartemplatesasset) - AngularJS templates for you AngularJS folks.\n\n#### Static\n* [StaticAssets](https://github.com/techpines/asset-rack-new/tree/master/lib#staticassets) - Images(png, jpg, gif), fonts, whatever you got.\n\n## Roll your own\n\nAsset Rack is extremely flexible.  Extend the __Asset__ class and override the __create__ method to roll your own awesomeness, and watch them get automatically ka-pow'ed by your rack.\n\n```js\nSuperCoolAsset = rack.Asset.extend({\n    create: function(options) {\n        this.contents = 'easy, easy'\n        this.emit 'created'\n    }\n})\n```\nOr, for those with more refined taste:\n\n```coffee\nclass SuperCoolAsset extends rack.Asset\n    create: (options) ->\n        @contents = 'even easier with coffee'\n        @emit 'created'\n```\n\nCheckout the [tutorial.](https://github.com/techpines/asset-rack-new/tree/master/lib#extending-the-asset-class)\n\n\n## Deploying to the Cloud\nYour assets need to be deployed! Here are the current providers that are supported.\n\n### Amazon S3\n\n```js\nassets.deploy({\n    provider: 'amazon',\n    container: 'some-bucket',\n    accessKey: 'aws-access-key',\n    secretKey: 'aws-secret-key',\n}, function(error) {})\n```\n\n### Rackspace Cloud Files\n```js\nassets.deploy(\n    provider: 'rackspace',\n    container: 'some-container',\n    username: 'rackspace-username',\n    apiKey: 'rackspace-api-key',\n}, function(error) {})\n```\n\n### Azure Storage\n```js\nassets.deploy(\n    provider: 'azure',\n    container: 'some-container',\n    storageAccount: 'test-storage-account',\n    storageAccessKey: 'test-storage-access-key'\n}, function(error) {})\n```\n\n\n## FAQ\n\n#### __Why is this better than Connect-Assets?__\n\nThat's easy!\n\n* It works with node.js multi-process and cluster.\n* More built-in assets.\n* Un-opionated, connect-assets dictates your url structure AND directory structure.\n* Ability to deploy to the cloud.\n* Easy to extend.\n* Simpler to use.\n\nWith all that said, much thanks to Trevor for writing connect-assets. \n\n#### __Why is this better than Grunt?__\n\nGrunt is a great build tool.  Asset Rack is not a build a tool.  It never writes files to disk, there is no \"build step\".  Everything happens \"just in time\".\n\nIf you have \"genuine\" build issues, then by all means use Grunt.  You can even use Grunt with Asset Rack.\n\nHowever, if you are only using Grunt to manage your static assets, then you should consider upgrading to Asset Rack.\n\n#### __Why is this better than Wintersmith(Blacksmith)?__\n\nAsset Rack is a static web framework, and at it's core there are only two abstractions, the `Asset` and `Rack` classes.  Wintersmith is a high level framework that solves a more specific problem.\n\nWintersmith could consume Asset Rack as a dependency, and if something more high-level fits your specific use case, then by all means that is probably a good fit.  If you need more flexibilty and power, then go with Asset Rack.\n\n# License\n\n©2012 Brad Carleton, Tech Pines and available under the [MIT license](http://www.opensource.org/licenses/mit-license.php):\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","readmeFilename":"README.md","_id":"asset-rack@2.0.5","dist":{"shasum":"ca2af914b9b9acc55b926cbef3662eb0d66058d9","tarball":"https://registry.npmjs.org/asset-rack/-/asset-rack-2.0.5.tgz","integrity":"sha512-KM8vke9aUlfEgtpScWU2bdBKbrbbsG+mOKSx6N8KiIqwFZjYpqlTUA3iXP+vakKRO9R443Koy5Ekv/qoriVb1A==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCfaT1ngirHqlYVSU2y5sxhtlWsMara9EJFeCz/D4NV0AIgQ6dPVkhsIDHJ9e83O2Ys4AAF9PVwwmmpwDxaVKvbsmg="}]},"_npmVersion":"1.1.65","_npmUser":{"name":"brad@techpines.com","email":"brad@techpines.com"},"maintainers":[{"name":"brad@techpines.com","email":"brad@techpines.com"}],"directories":{}},"2.0.6":{"name":"asset-rack","version":"2.0.6","description":"Asset management framework for nodejs","author":{"name":"Brad Carleton","email":"brad@techpines.com"},"repository":{"type":"git","url":"https://github.com/techpines/asset-rack"},"dependencies":{"coffee-script":"1.4.0","browserify":"1.17.3","snockets":"1.3.8","uglify-js":"2.2.4","async":"0.1.22","pkgcloud":"0.6.6","less":"1.3.3","jade":"0.27.7","mime":"1.2.7","nib":"0.9.1","stylus":"0.32.0","underscore":"1.4.4","markdown":"0.4.0"},"devDependencies":{"express.io":"1.1.8","request":"2.12.0","mocha":"1.8.1","chai":"1.4.2"},"scripts":{"test":"mocha --compilers coffee:coffee-script test/test.coffee --reporter spec --timeout 5000 --ignore-leaks"},"main":"switch.js","engines":{"node":">= 0.5.0"},"readme":"\n<img src=\"https://s3.amazonaws.com/temp.techpines.com/asset-rack-white.png\">\n\n# The Static Web is here\n\nThe Static Web is __blisteringly fast__.  The Static Web is  __ultra efficient__.  The Static Web is __cutting edge__.  And now it has a hero.\n\n```coffeescript\nrack = require 'asset-rack'\n```\n\nThe Static Web is an incredibly modern, high-performance platform for delivering apps and services.  But before you dive-in, you need to start with the basics.  You need to understand the fundamental building block of the static web, the __asset__.\n\n\n## What is an Asset?\n\n> __An asset is a resource on the web that has the following three features:__\n\n1. __Location (URL)__: Where on the web the resource is located.\n2. __Contents (HTTP Response Body)__: The body of the response received by a web client.\n3. __Meta Data (HTTP Headers)__: Gives information about the resource, like content-type, caching info.\n\nThis simple definition is the theoretical bedrock of this entire framework.\n\n## Getting Started\n\nLet's look at a simple example.\n\n```js\nasset = new rack.Asset({\n    url: '/hello.txt',\n    contents: 'hello world'\n})\n```\n\nNeed to serve that asset with a blisteringly fast in memory cache using express?\n\n```\napp.use(asset)\n```\n\n### Hash for speed and efficiency\n\nWhat's cool is that this new asset is available both here:\n\n```\n/hello.txt\n```\n\nAnd here\n\n```\n/hello-5eb63bbbe01eeed093cb22bb8f5acdc3.txt\n```\n\nThat long string of letters and numbers is the md5 hash of the contents.  If you hit the hash url, then we automatically set the HTTP cache to __never expire__.  \n\nNow proxies, browsers, cloud storage, content delivery networks only need to download your asset one single time.  You have versioning, conflict resolution all in one simple mechanism.  You can update your entire entire app instantaneously.  Fast, efficient, static.\n\n### One Rack to rule them All\n\nAssets need to be managed.  Enter the Rack.  A Rack serializes your assets, allows you to deploy to the cloud, and reference urls and tags in your templates.\n\nSay you have a directory structure like this:\n\n```\n/static      # all your images, fonts, etc.\n/style.less  # a less files with your styles\n```\n\nYou can create a Rack to put all your assets in.\n\n```js\nassets = new rack.Rack([\n    new rack.StaticAssets({\n        urlPrefix: '/static'\n        dirname: __dirname + '/static'\n    }),\n    new rack.LessAsset({\n        url: '/style.css'\n        filename: __dirname + '/style.less'\n    }\n])\n```\n\n### Use in your Templates\n\nAfter you hook into express, you can reference your assets in your server side templates.\n\n```js\nassets.tag('/style.css')\n```\n\nWhich gives you the html tag.\n\n```html\n<link href=\"/style-0f2j9fj039fuw0e9f23.css\" rel=\"stylesheet\">\n```\n\nOr you can grab just the url.\n\n```js\nassets.url('/logo.png')\n```\n\nWhich gives the hashed url.\n\n```\n/logo-34t90j0re9g034o4f3o4f3.png\n```\n\n# Batteries Included\n\nWe have some professional grade assets included.\n\n#### For Javascript\n* [Browserify](https://github.com/techpines/asset-rack-new/tree/master/lib#browserify-jscoffeescript) - Create browserify assets that allow you to use \"node-style\" requires on the client-side.\n* [Snockets](https://github.com/techpines/asset-rack-new/tree/master/lib#snockets-jscoffeescript) - Create snockets assets, to get the node-flavor of the \"sprockets\" from rails.\n\n#### For Stylesheets\n* [Less](http://github.com/techpines/asset-rack-new/tree/master/lib#lessasset) - Compile less assets, ability to use dependencies, minification.\n* [Stylus](https://github.com/techpines/asset-rack-new/tree/master/lib#stylusasset) - Compile stylu assets, ability to use dependencies, minification.\n\n#### Templates\n* [Jade](https://github.com/techpines/asset-rack-new/tree/master/lib#jadeasset) - High, performance jade templates precompiled for the browser.\n* [AngularTemplates](https://github.com/techpines/asset-rack-new/tree/master/lib#angulartemplatesasset) - AngularJS templates for you AngularJS folks.\n\n#### Static\n* [StaticAssets](https://github.com/techpines/asset-rack-new/tree/master/lib#staticassets) - Images(png, jpg, gif), fonts, whatever you got.\n\n## Roll your own\n\nAsset Rack is extremely flexible.  Extend the __Asset__ class and override the __create__ method to roll your own awesomeness, and watch them get automatically ka-pow'ed by your rack.\n\n```js\nSuperCoolAsset = rack.Asset.extend({\n    create: function(options) {\n        this.contents = 'easy, easy'\n        this.emit 'created'\n    }\n})\n```\nOr, for those with more refined taste:\n\n```coffee\nclass SuperCoolAsset extends rack.Asset\n    create: (options) ->\n        @contents = 'even easier with coffee'\n        @emit 'created'\n```\n\nCheckout the [tutorial.](https://github.com/techpines/asset-rack-new/tree/master/lib#extending-the-asset-class)\n\n\n## Deploying to the Cloud\nYour assets need to be deployed! Here are the current providers that are supported.\n\n### Amazon S3\n\n```js\nassets.deploy({\n    provider: 'amazon',\n    container: 'some-bucket',\n    accessKey: 'aws-access-key',\n    secretKey: 'aws-secret-key',\n}, function(error) {})\n```\n\n### Rackspace Cloud Files\n```js\nassets.deploy(\n    provider: 'rackspace',\n    container: 'some-container',\n    username: 'rackspace-username',\n    apiKey: 'rackspace-api-key',\n}, function(error) {})\n```\n\n### Azure Storage\n```js\nassets.deploy(\n    provider: 'azure',\n    container: 'some-container',\n    storageAccount: 'test-storage-account',\n    storageAccessKey: 'test-storage-access-key'\n}, function(error) {})\n```\n\n\n## FAQ\n\n#### __Why is this better than Connect-Assets?__\n\nThat's easy!\n\n* It works with node.js multi-process and cluster.\n* More built-in assets.\n* Un-opionated, connect-assets dictates your url structure AND directory structure.\n* Ability to deploy to the cloud.\n* Easy to extend.\n* Simpler to use.\n\nWith all that said, much thanks to Trevor for writing connect-assets. \n\n#### __Why is this better than Grunt?__\n\nGrunt is a great build tool.  Asset Rack is not a build a tool.  It never writes files to disk, there is no \"build step\".  Everything happens \"just in time\".\n\nIf you have \"genuine\" build issues, then by all means use Grunt.  You can even use Grunt with Asset Rack.\n\nHowever, if you are only using Grunt to manage your static assets, then you should consider upgrading to Asset Rack.\n\n#### __Why is this better than Wintersmith(Blacksmith)?__\n\nAsset Rack is a static web framework, and at it's core there are only two abstractions, the `Asset` and `Rack` classes.  Wintersmith is a high level framework that solves a more specific problem.\n\nWintersmith could consume Asset Rack as a dependency, and if something more high-level fits your specific use case, then by all means that is probably a good fit.  If you need more flexibilty and power, then go with Asset Rack.\n\n# License\n\n©2012 Brad Carleton, Tech Pines and available under the [MIT license](http://www.opensource.org/licenses/mit-license.php):\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","readmeFilename":"README.md","_id":"asset-rack@2.0.6","dist":{"shasum":"658e991d22a5a2cd6a9c2eb7fb6c8cfb1e93969c","tarball":"https://registry.npmjs.org/asset-rack/-/asset-rack-2.0.6.tgz","integrity":"sha512-Ft/cj2bEhoNZ51Jyip0C8AQpTFpTkSaRvXvWTDN2m3JiDrYDe9pSQQBOmUxYhLmj/Jq5GGRg3WeADlLl8XnqtA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDM9A/3xKgYAJPkhU0wA8npRabxhaDp9vP1E89KCMk6dAiEAmu4rdkFad0XP9awrdQcJ+swGxu3o0D3SQSPUHCIbJs0="}]},"_npmVersion":"1.1.65","_npmUser":{"name":"brad@techpines.com","email":"brad@techpines.com"},"maintainers":[{"name":"brad@techpines.com","email":"brad@techpines.com"}],"directories":{}},"2.0.7":{"name":"asset-rack","version":"2.0.7","description":"Asset management framework for nodejs","author":{"name":"Brad Carleton","email":"brad@techpines.com"},"repository":{"type":"git","url":"https://github.com/techpines/asset-rack"},"dependencies":{"coffee-script":"1.4.0","browserify":"1.17.3","snockets":"1.3.8","uglify-js":"2.2.4","async":"0.1.22","pkgcloud":"0.6.6","less":"1.3.3","jade":"0.27.7","mime":"1.2.7","nib":"0.9.1","stylus":"0.32.0","underscore":"1.4.4","markdown":"0.4.0"},"devDependencies":{"express.io":"1.1.8","request":"2.12.0","mocha":"1.8.1","chai":"1.4.2"},"scripts":{"test":"mocha --compilers coffee:coffee-script test/test.coffee --reporter spec --timeout 5000 --ignore-leaks"},"main":"switch.js","engines":{"node":">= 0.5.0"},"readme":"\n<img src=\"https://s3.amazonaws.com/temp.techpines.com/asset-rack-white.png\">\n\n# The Static Web is here\n\nThe Static Web is __blisteringly fast__.  The Static Web is  __ultra efficient__.  The Static Web is __cutting edge__.  And now it has a hero.\n\n```coffeescript\nrack = require 'asset-rack'\n```\n\nThe Static Web is an incredibly modern, high-performance platform for delivering apps and services.  But before you dive-in, you need to start with the basics.  You need to understand the fundamental building block of the static web, the __asset__.\n\n\n## What is an Asset?\n\n> __An asset is a resource on the web that has the following three features:__\n\n1. __Location (URL)__: Where on the web the resource is located.\n2. __Contents (HTTP Response Body)__: The body of the response received by a web client.\n3. __Meta Data (HTTP Headers)__: Gives information about the resource, like content-type, caching info.\n\nThis simple definition is the theoretical bedrock of this entire framework.\n\n## Getting Started\n\nLet's look at a simple example.\n\n```js\nasset = new rack.Asset({\n    url: '/hello.txt',\n    contents: 'hello world'\n})\n```\n\nNeed to serve that asset with a blisteringly fast in memory cache using express?\n\n```\napp.use(asset)\n```\n\n### Hash for speed and efficiency\n\nWhat's cool is that this new asset is available both here:\n\n```\n/hello.txt\n```\n\nAnd here\n\n```\n/hello-5eb63bbbe01eeed093cb22bb8f5acdc3.txt\n```\n\nThat long string of letters and numbers is the md5 hash of the contents.  If you hit the hash url, then we automatically set the HTTP cache to __never expire__.  \n\nNow proxies, browsers, cloud storage, content delivery networks only need to download your asset one single time.  You have versioning, conflict resolution all in one simple mechanism.  You can update your entire entire app instantaneously.  Fast, efficient, static.\n\n### One Rack to rule them All\n\nAssets need to be managed.  Enter the Rack.  A Rack serializes your assets, allows you to deploy to the cloud, and reference urls and tags in your templates.\n\nSay you have a directory structure like this:\n\n```\n/static      # all your images, fonts, etc.\n/style.less  # a less files with your styles\n```\n\nYou can create a Rack to put all your assets in.\n\n```js\nassets = new rack.Rack([\n    new rack.StaticAssets({\n        urlPrefix: '/static'\n        dirname: __dirname + '/static'\n    }),\n    new rack.LessAsset({\n        url: '/style.css'\n        filename: __dirname + '/style.less'\n    }\n])\n```\n\n### Use in your Templates\n\nAfter you hook into express, you can reference your assets in your server side templates.\n\n```js\nassets.tag('/style.css')\n```\n\nWhich gives you the html tag.\n\n```html\n<link href=\"/style-0f2j9fj039fuw0e9f23.css\" rel=\"stylesheet\">\n```\n\nOr you can grab just the url.\n\n```js\nassets.url('/logo.png')\n```\n\nWhich gives the hashed url.\n\n```\n/logo-34t90j0re9g034o4f3o4f3.png\n```\n\n# Batteries Included\n\nWe have some professional grade assets included.\n\n#### For Javascript\n* [Browserify](https://github.com/techpines/asset-rack-new/tree/master/lib#browserify-jscoffeescript) - Create browserify assets that allow you to use \"node-style\" requires on the client-side.\n* [Snockets](https://github.com/techpines/asset-rack-new/tree/master/lib#snockets-jscoffeescript) - Create snockets assets, to get the node-flavor of the \"sprockets\" from rails.\n\n#### For Stylesheets\n* [Less](http://github.com/techpines/asset-rack-new/tree/master/lib#lessasset) - Compile less assets, ability to use dependencies, minification.\n* [Stylus](https://github.com/techpines/asset-rack-new/tree/master/lib#stylusasset) - Compile stylu assets, ability to use dependencies, minification.\n\n#### Templates\n* [Jade](https://github.com/techpines/asset-rack-new/tree/master/lib#jadeasset) - High, performance jade templates precompiled for the browser.\n* [AngularTemplates](https://github.com/techpines/asset-rack-new/tree/master/lib#angulartemplatesasset) - AngularJS templates for you AngularJS folks.\n\n#### Static\n* [StaticAssets](https://github.com/techpines/asset-rack-new/tree/master/lib#staticassets) - Images(png, jpg, gif), fonts, whatever you got.\n\n## Roll your own\n\nAsset Rack is extremely flexible.  Extend the __Asset__ class and override the __create__ method to roll your own awesomeness, and watch them get automatically ka-pow'ed by your rack.\n\n```js\nSuperCoolAsset = rack.Asset.extend({\n    create: function(options) {\n        this.contents = 'easy, easy'\n        this.emit 'created'\n    }\n})\n```\nOr, for those with more refined taste:\n\n```coffee\nclass SuperCoolAsset extends rack.Asset\n    create: (options) ->\n        @contents = 'even easier with coffee'\n        @emit 'created'\n```\n\nCheckout the [tutorial.](https://github.com/techpines/asset-rack-new/tree/master/lib#extending-the-asset-class)\n\n\n## Deploying to the Cloud\nYour assets need to be deployed! Here are the current providers that are supported.\n\n### Amazon S3\n\n```js\nassets.deploy({\n    provider: 'amazon',\n    container: 'some-bucket',\n    accessKey: 'aws-access-key',\n    secretKey: 'aws-secret-key',\n}, function(error) {})\n```\n\n### Rackspace Cloud Files\n```js\nassets.deploy(\n    provider: 'rackspace',\n    container: 'some-container',\n    username: 'rackspace-username',\n    apiKey: 'rackspace-api-key',\n}, function(error) {})\n```\n\n### Azure Storage\n```js\nassets.deploy(\n    provider: 'azure',\n    container: 'some-container',\n    storageAccount: 'test-storage-account',\n    storageAccessKey: 'test-storage-access-key'\n}, function(error) {})\n```\n\n\n## FAQ\n\n#### __Why is this better than Connect-Assets?__\n\nThat's easy!\n\n* It works with node.js multi-process and cluster.\n* More built-in assets.\n* Un-opionated, connect-assets dictates your url structure AND directory structure.\n* Ability to deploy to the cloud.\n* Easy to extend.\n* Simpler to use.\n\nWith all that said, much thanks to Trevor for writing connect-assets. \n\n#### __Why is this better than Grunt?__\n\nGrunt is a great build tool.  Asset Rack is not a build a tool.  It never writes files to disk, there is no \"build step\".  Everything happens \"just in time\".\n\nIf you have \"genuine\" build issues, then by all means use Grunt.  You can even use Grunt with Asset Rack.\n\nHowever, if you are only using Grunt to manage your static assets, then you should consider upgrading to Asset Rack.\n\n#### __Why is this better than Wintersmith(Blacksmith)?__\n\nAsset Rack is a static web framework, and at it's core there are only two abstractions, the `Asset` and `Rack` classes.  Wintersmith is a high level framework that solves a more specific problem.\n\nWintersmith could consume Asset Rack as a dependency, and if something more high-level fits your specific use case, then by all means that is probably a good fit.  If you need more flexibilty and power, then go with Asset Rack.\n\n# License\n\n©2012 Brad Carleton, Tech Pines and available under the [MIT license](http://www.opensource.org/licenses/mit-license.php):\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","readmeFilename":"README.md","_id":"asset-rack@2.0.7","dist":{"shasum":"b6ebb33f62c3393bb8db1b018b9518c870bb372d","tarball":"https://registry.npmjs.org/asset-rack/-/asset-rack-2.0.7.tgz","integrity":"sha512-kqJSYuK2s8WPKqWWGx+xJZGJ/MW8A3ht62TTbjRU1zlQrNolzNC4KiSyvYQIsxru+t4yqPND+JogXSgVoF4aNg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICOijggoz/BFmmF5Mlv3uNlNNzuo2Ti+KpMfgOVRf/xaAiAOuIDpoIYXefwzU4r/iWsu2ATkQB0ptPw2z52NZqxs/g=="}]},"_npmVersion":"1.1.65","_npmUser":{"name":"brad@techpines.com","email":"brad@techpines.com"},"maintainers":[{"name":"brad@techpines.com","email":"brad@techpines.com"}],"directories":{}},"2.0.8":{"name":"asset-rack","version":"2.0.8","description":"Static Web Framework for Nodejs","author":{"name":"Brad Carleton","email":"brad@techpines.com"},"repository":{"type":"git","url":"https://github.com/techpines/asset-rack"},"dependencies":{"browserify":"1.17.3","snockets":"1.3.8","uglify-js":"2.2.4","async":"0.1.22","pkgcloud":"0.6.6","less":"1.3.3","jade":"0.27.7","mime":"1.2.7","nib":"0.9.1","stylus":"0.32.0","underscore":"1.4.4","coffee-script":"1.4.0","markdown":"0.4.0"},"devDependencies":{"express.io":"1.1.8","request":"2.12.0","mocha":"1.8.1","chai":"1.4.2"},"scripts":{"test":"mocha --compilers coffee:coffee-script test/test.coffee --reporter spec --timeout 5000 --ignore-leaks","compile":"./node_modules/coffee-script/bin/coffee -o compiled/ -c lib/","prepublish":"echo $(pwd) > /tmp/.pwd; ./node_modules/coffee-script/bin/coffee -o compiled/ -c lib/;","postpublish":"rm -rf $(cat /tmp/.pwd)/compiled"},"main":"switch.js","engines":{"node":">= 0.5.0"},"readme":"\n<img src=\"https://s3.amazonaws.com/temp.techpines.com/asset-rack-white.png\">\n\n# The Static Web is here\n\nThe Static Web is __blisteringly fast__.  The Static Web is  __ultra efficient__.  The Static Web is __cutting edge__.  And now it has a hero.\n\n```coffeescript\nrack = require 'asset-rack'\n```\n\nThe Static Web is an incredibly modern, high-performance platform for delivering apps and services.  But before you dive-in, you need to start with the basics.  You need to understand the fundamental building block of the static web, the __asset__.\n\n\n## What is an Asset?\n\n> __An asset is a resource on the web that has the following three features:__\n\n1. __Location (URL)__: Where on the web the resource is located.\n2. __Contents (HTTP Response Body)__: The body of the response received by a web client.\n3. __Meta Data (HTTP Headers)__: Gives information about the resource, like content-type, caching info.\n\nThis simple definition is the theoretical bedrock of this entire framework.\n\n## Getting Started\n\nLet's look at a simple example.\n\n```js\nasset = new rack.Asset({\n    url: '/hello.txt',\n    contents: 'hello world'\n})\n```\n\nNeed to serve that asset with a blisteringly fast in memory cache using express?\n\n```\napp.use(asset)\n```\n\n### Hash for speed and efficiency\n\nWhat's cool is that this new asset is available both here:\n\n```\n/hello.txt\n```\n\nAnd here\n\n```\n/hello-5eb63bbbe01eeed093cb22bb8f5acdc3.txt\n```\n\nThat long string of letters and numbers is the md5 hash of the contents.  If you hit the hash url, then we automatically set the HTTP cache to __never expire__.  \n\nNow proxies, browsers, cloud storage, content delivery networks only need to download your asset one single time.  You have versioning, conflict resolution all in one simple mechanism.  You can update your entire entire app instantaneously.  Fast, efficient, static.\n\n### One Rack to rule them All\n\nAssets need to be managed.  Enter the Rack.  A Rack serializes your assets, allows you to deploy to the cloud, and reference urls and tags in your templates.\n\nSay you have a directory structure like this:\n\n```\n/static      # all your images, fonts, etc.\n/style.less  # a less files with your styles\n```\n\nYou can create a Rack to put all your assets in.\n\n```js\nassets = new rack.Rack([\n    new rack.StaticAssets({\n        urlPrefix: '/static'\n        dirname: __dirname + '/static'\n    }),\n    new rack.LessAsset({\n        url: '/style.css'\n        filename: __dirname + '/style.less'\n    }\n])\n```\n\n### Use in your Templates\n\nAfter you hook into express, you can reference your assets in your server side templates.\n\n```js\nassets.tag('/style.css')\n```\n\nWhich gives you the html tag.\n\n```html\n<link href=\"/style-0f2j9fj039fuw0e9f23.css\" rel=\"stylesheet\">\n```\n\nOr you can grab just the url.\n\n```js\nassets.url('/logo.png')\n```\n\nWhich gives the hashed url.\n\n```\n/logo-34t90j0re9g034o4f3o4f3.png\n```\n\n# Batteries Included\n\nWe have some professional grade assets included.\n\n#### For Javascript\n* [Browserify](https://github.com/techpines/asset-rack/tree/master/lib#browserify-jscoffeescript) - Create browserify assets that allow you to use \"node-style\" requires on the client-side.\n* [Snockets](https://github.com/techpines/asset-rack/tree/master/lib#snockets-jscoffeescript) - Create snockets assets, to get the node-flavor of the \"sprockets\" from rails.\n\n#### For Stylesheets\n* [Less](http://github.com/techpines/asset-rack/tree/master/lib#lessasset) - Compile less assets, ability to use dependencies, minification.\n* [Stylus](https://github.com/techpines/asset-rack/tree/master/lib#stylusasset) - Compile stylu assets, ability to use dependencies, minification.\n\n#### Templates\n* [Jade](https://github.com/techpines/asset-rack/tree/master/lib#jadeasset) - High, performance jade templates precompiled for the browser.\n* [AngularTemplates](https://github.com/techpines/asset-rack/tree/master/lib#angulartemplatesasset) - AngularJS templates for you AngularJS folks.\n\n#### Static\n* [StaticAssets](https://github.com/techpines/asset-rack/tree/master/lib#staticassets) - Images(png, jpg, gif), fonts, whatever you got.\n\n## Roll your own\n\nAsset Rack is extremely flexible.  Extend the __Asset__ class and override the __create__ method to roll your own awesomeness, and watch them get automatically ka-pow'ed by your rack.\n\n```js\nSuperCoolAsset = rack.Asset.extend({\n    create: function(options) {\n        this.contents = 'easy, easy'\n        this.emit 'created'\n    }\n})\n```\nOr, for those with more refined taste:\n\n```coffee\nclass SuperCoolAsset extends rack.Asset\n    create: (options) ->\n        @contents = 'even easier with coffee'\n        @emit 'created'\n```\n\nCheckout the [tutorial.](https://github.com/techpines/asset-rack/tree/master/lib#extending-the-asset-class)\n\n\n## Deploying to the Cloud\nYour assets need to be deployed! Here are the current providers that are supported.\n\n### Amazon S3\n\n```js\nassets.deploy({\n    provider: 'amazon',\n    container: 'some-bucket',\n    accessKey: 'aws-access-key',\n    secretKey: 'aws-secret-key',\n}, function(error) {})\n```\n\n### Rackspace Cloud Files\n```js\nassets.deploy(\n    provider: 'rackspace',\n    container: 'some-container',\n    username: 'rackspace-username',\n    apiKey: 'rackspace-api-key',\n}, function(error) {})\n```\n\n### Azure Storage\n```js\nassets.deploy(\n    provider: 'azure',\n    container: 'some-container',\n    storageAccount: 'test-storage-account',\n    storageAccessKey: 'test-storage-access-key'\n}, function(error) {})\n```\n\n\n## FAQ\n\n#### __Why is this better than Connect-Assets?__\n\nThat's easy!\n\n* It works with node.js multi-process and cluster.\n* More built-in assets.\n* Un-opionated, connect-assets dictates your url structure AND directory structure.\n* Ability to deploy to the cloud.\n* Easy to extend.\n* Simpler to use.\n\nWith all that said, much thanks to Trevor for writing connect-assets. \n\n#### __Why is this better than Grunt?__\n\nGrunt is a great build tool.  Asset Rack is not a build a tool.  It never writes files to disk, there is no \"build step\".  Everything happens \"just in time\".\n\nIf you have \"genuine\" build issues, then by all means use Grunt.  You can even use Grunt with Asset Rack.\n\nHowever, if you are only using Grunt to manage your static assets, then you should consider upgrading to Asset Rack.\n\n#### __Why is this better than Wintersmith(Blacksmith)?__\n\nAsset Rack is a static web framework, and at it's core there are only two abstractions, the `Asset` and `Rack` classes.  Wintersmith is a high level framework that solves a more specific problem.\n\nWintersmith could consume Asset Rack as a dependency, and if something more high-level fits your specific use case, then by all means that is probably a good fit.  If you need more flexibilty and power, then go with Asset Rack.\n\n# License\n\n©2012 Brad Carleton, Tech Pines and available under the [MIT license](http://www.opensource.org/licenses/mit-license.php):\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","readmeFilename":"README.md","_id":"asset-rack@2.0.8","dist":{"shasum":"d9ff00240dbd59c40e6f1e55d43ad79293216a8c","tarball":"https://registry.npmjs.org/asset-rack/-/asset-rack-2.0.8.tgz","integrity":"sha512-5WSdvca7xsV8nGfLGqV0xnhy2fBLKDDDO+K/JkXoqWOQ5H5+hrNcUfq8MnqOl65Gi2nI0wt4mFqSEREsdwN9qw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDBKnAupMKyTT7LOoHwsfmzLW0kOke50eXw98CMnFJyagIgWBy7it07NkZOg96ed1haqPDMHmXwTIgjD17u78WB1EM="}]},"_npmVersion":"1.1.65","_npmUser":{"name":"brad@techpines.com","email":"brad@techpines.com"},"maintainers":[{"name":"brad@techpines.com","email":"brad@techpines.com"}],"directories":{}},"2.0.9":{"name":"asset-rack","version":"2.0.9","description":"Static Web Framework for Nodejs","author":{"name":"Brad Carleton","email":"brad@techpines.com"},"repository":{"type":"git","url":"https://github.com/techpines/asset-rack"},"dependencies":{"browserify":"1.17.3","snockets":"1.3.8","uglify-js":"2.2.4","async":"0.1.22","pkgcloud":"0.6.6","less":"1.3.3","jade":"0.27.7","mime":"1.2.7","nib":"0.9.1","stylus":"0.32.0","underscore":"1.4.4","coffee-script":"1.4.0","markdown":"0.4.0"},"devDependencies":{"express.io":"1.1.8","request":"2.12.0","mocha":"1.8.1","chai":"1.4.2"},"scripts":{"test":"mocha --compilers coffee:coffee-script test/test.coffee --reporter spec --timeout 5000 --ignore-leaks","compile":"./node_modules/coffee-script/bin/coffee -o compiled/ -c lib/","prepublish":"echo $(pwd) > /tmp/.pwd; ./node_modules/coffee-script/bin/coffee -o compiled/ -c lib/;","postpublish":"rm -rf $(cat /tmp/.pwd)/compiled"},"main":"switch.js","engines":{"node":">= 0.5.0"},"readme":"\n<img src=\"https://s3.amazonaws.com/temp.techpines.com/asset-rack-white.png\">\n\n# The Static Web is here\n\nThe Static Web is __blisteringly fast__.  The Static Web is  __ultra efficient__.  The Static Web is __cutting edge__.  And now it has a hero.\n\n```coffeescript\nrack = require 'asset-rack'\n```\n\nThe Static Web is an incredibly modern, high-performance platform for delivering apps and services.  But before you dive-in, you need to start with the basics.  You need to understand the fundamental building block of the static web, the __asset__.\n\n\n## What is an Asset?\n\n> __An asset is a resource on the web that has the following three features:__\n\n1. __Location (URL)__: Where on the web the resource is located.\n2. __Contents (HTTP Response Body)__: The body of the response received by a web client.\n3. __Meta Data (HTTP Headers)__: Gives information about the resource, like content-type, caching info.\n\nThis simple definition is the theoretical bedrock of this entire framework.\n\n## Getting Started\n\nLet's look at a simple example.\n\n```js\nasset = new rack.Asset({\n    url: '/hello.txt',\n    contents: 'hello world'\n})\n```\n\nNeed to serve that asset with a blisteringly fast in memory cache using express?\n\n```\napp.use(asset)\n```\n\n### Hash for speed and efficiency\n\nWhat's cool is that this new asset is available both here:\n\n```\n/hello.txt\n```\n\nAnd here\n\n```\n/hello-5eb63bbbe01eeed093cb22bb8f5acdc3.txt\n```\n\nThat long string of letters and numbers is the md5 hash of the contents.  If you hit the hash url, then we automatically set the HTTP cache to __never expire__.  \n\nNow proxies, browsers, cloud storage, content delivery networks only need to download your asset one single time.  You have versioning, conflict resolution all in one simple mechanism.  You can update your entire entire app instantaneously.  Fast, efficient, static.\n\n### One Rack to rule them All\n\nAssets need to be managed.  Enter the Rack.  A Rack serializes your assets, allows you to deploy to the cloud, and reference urls and tags in your templates.\n\nSay you have a directory structure like this:\n\n```\n/static      # all your images, fonts, etc.\n/style.less  # a less files with your styles\n```\n\nYou can create a Rack to put all your assets in.\n\n```js\nassets = new rack.Rack([\n    new rack.StaticAssets({\n        urlPrefix: '/static'\n        dirname: __dirname + '/static'\n    }),\n    new rack.LessAsset({\n        url: '/style.css'\n        filename: __dirname + '/style.less'\n    }\n])\n```\n\n### Use in your Templates\n\nAfter you hook into express, you can reference your assets in your server side templates.\n\n```js\nassets.tag('/style.css')\n```\n\nWhich gives you the html tag.\n\n```html\n<link href=\"/style-0f2j9fj039fuw0e9f23.css\" rel=\"stylesheet\">\n```\n\nOr you can grab just the url.\n\n```js\nassets.url('/logo.png')\n```\n\nWhich gives the hashed url.\n\n```\n/logo-34t90j0re9g034o4f3o4f3.png\n```\n\n# Batteries Included\n\nWe have some professional grade assets included.\n\n#### For Javascript\n* [Browserify](https://github.com/techpines/asset-rack/tree/master/lib#browserifyasset-jscoffeescript) - Create browserify assets that allow you to use \"node-style\" requires on the client-side.\n* [Snockets](https://github.com/techpines/asset-rack/tree/master/lib#snocketsasset-jscoffeescript) - Create snockets assets, to get the node-flavor of the \"sprockets\" from rails.\n\n#### For Stylesheets\n* [Less](http://github.com/techpines/asset-rack/tree/master/lib#lessasset) - Compile less assets, ability to use dependencies, minification.\n* [Stylus](https://github.com/techpines/asset-rack/tree/master/lib#stylusasset) - Compile stylu assets, ability to use dependencies, minification.\n\n#### Templates\n* [Jade](https://github.com/techpines/asset-rack/tree/master/lib#jadeasset) - High, performance jade templates precompiled for the browser.\n* [AngularTemplates](https://github.com/techpines/asset-rack/tree/master/lib#angulartemplatesasset) - AngularJS templates for you AngularJS folks.\n\n#### Static\n* [StaticAssets](https://github.com/techpines/asset-rack/tree/master/lib#staticassets) - Images(png, jpg, gif), fonts, whatever you got.\n\n## Roll your own\n\nAsset Rack is extremely flexible.  Extend the __Asset__ class and override the __create__ method to roll your own awesomeness, and watch them get automatically ka-pow'ed by your rack.\n\n```js\nSuperCoolAsset = rack.Asset.extend({\n    create: function(options) {\n        this.contents = 'easy, easy'\n        this.emit 'created'\n    }\n})\n```\nOr, for those with more refined taste:\n\n```coffee\nclass SuperCoolAsset extends rack.Asset\n    create: (options) ->\n        @contents = 'even easier with coffee'\n        @emit 'created'\n```\n\nCheckout the [tutorial.](https://github.com/techpines/asset-rack/tree/master/lib#extending-the-asset-class)\n\n\n## Deploying to the Cloud\nYour assets need to be deployed! Here are the current providers that are supported.\n\n### Amazon S3\n\n```js\nassets.deploy({\n    provider: 'amazon',\n    container: 'some-bucket',\n    accessKey: 'aws-access-key',\n    secretKey: 'aws-secret-key',\n}, function(error) {})\n```\n\n### Rackspace Cloud Files\n```js\nassets.deploy(\n    provider: 'rackspace',\n    container: 'some-container',\n    username: 'rackspace-username',\n    apiKey: 'rackspace-api-key',\n}, function(error) {})\n```\n\n### Azure Storage\n```js\nassets.deploy(\n    provider: 'azure',\n    container: 'some-container',\n    storageAccount: 'test-storage-account',\n    storageAccessKey: 'test-storage-access-key'\n}, function(error) {})\n```\n\n\n## FAQ\n\n#### __Why is this better than Connect-Assets?__\n\nThat's easy!\n\n* It works with node.js multi-process and cluster.\n* More built-in assets.\n* Un-opionated, connect-assets dictates your url structure AND directory structure.\n* Ability to deploy to the cloud.\n* Easy to extend.\n* Simpler to use.\n\nWith all that said, much thanks to Trevor for writing connect-assets. \n\n#### __Why is this better than Grunt?__\n\nGrunt is a great build tool.  Asset Rack is not a build a tool.  It never writes files to disk, there is no \"build step\".  Everything happens \"just in time\".\n\nIf you have \"genuine\" build issues, then by all means use Grunt.  You can even use Grunt with Asset Rack.\n\nHowever, if you are only using Grunt to manage your static assets, then you should consider upgrading to Asset Rack.\n\n#### __Why is this better than Wintersmith(Blacksmith)?__\n\nAsset Rack is a static web framework, and at it's core there are only two abstractions, the `Asset` and `Rack` classes.  Wintersmith is a high level framework that solves a more specific problem.\n\nWintersmith could consume Asset Rack as a dependency, and if something more high-level fits your specific use case, then by all means that is probably a good fit.  If you need more flexibilty and power, then go with Asset Rack.\n\n# License\n\n©2012 Brad Carleton, Tech Pines and available under the [MIT license](http://www.opensource.org/licenses/mit-license.php):\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","readmeFilename":"README.md","_id":"asset-rack@2.0.9","dist":{"shasum":"c61bd95eb3ccb307b190ae5d386f3e695a4014c3","tarball":"https://registry.npmjs.org/asset-rack/-/asset-rack-2.0.9.tgz","integrity":"sha512-fE46xCsqv/KtgDkTHdiWYOGiMB+neTQS8hvrXNT4+DL5LNVluqbhGbmR64mD48mTen+olceVbWpvEF8PhqXNKw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCOqwL5Nn/dfZi2PK+/kvNaxqj9S1/iM9u5vepMDYb87wIhAPTCfYot0IMfCFHFgkcEp4OZ4dykAfEC6DjRa8IB9hLi"}]},"_npmVersion":"1.1.65","_npmUser":{"name":"brad@techpines.com","email":"brad@techpines.com"},"maintainers":[{"name":"brad@techpines.com","email":"brad@techpines.com"}],"directories":{}},"2.0.10":{"name":"asset-rack","version":"2.0.10","description":"Static Web Framework for Nodejs","author":{"name":"Brad Carleton","email":"brad@techpines.com"},"repository":{"type":"git","url":"https://github.com/techpines/asset-rack"},"dependencies":{"browserify":"1.17.3","snockets":"1.3.8","uglify-js":"2.2.4","async":"0.1.22","pkgcloud":"0.6.6","less":"1.3.3","jade":"0.27.7","mime":"1.2.7","nib":"0.9.1","stylus":"0.32.0","underscore":"1.4.4","coffee-script":"1.4.0","markdown":"0.4.0"},"devDependencies":{"express.io":"1.1.8","request":"2.12.0","mocha":"1.8.1","chai":"1.4.2"},"scripts":{"test":"mocha --compilers coffee:coffee-script test/test.coffee --reporter spec --timeout 5000 --ignore-leaks","compile":"./node_modules/coffee-script/bin/coffee -o compiled/ -c lib/","prepublish":"echo $(pwd) > /tmp/.pwd; ./node_modules/coffee-script/bin/coffee -o compiled/ -c lib/;","postpublish":"rm -rf $(cat /tmp/.pwd)/compiled"},"main":"switch.js","engines":{"node":">= 0.5.0"},"readme":"\n<img src=\"https://s3.amazonaws.com/temp.techpines.com/asset-rack-white.png\">\n\n# The Static Web is here\n\nThe Static Web is __blisteringly fast__.  The Static Web is  __ultra efficient__.  The Static Web is __cutting edge__.  And now it has a hero.\n\n```coffeescript\nrack = require 'asset-rack'\n```\n\nThe Static Web is an incredibly modern, high-performance platform for delivering apps and services.  But before you dive-in, you need to start with the basics.  You need to understand the fundamental building block of the static web, the __asset__.\n\n\n## What is an Asset?\n\n> __An asset is a resource on the web that has the following three features:__\n\n1. __Location (URL)__: Where on the web the resource is located.\n2. __Contents (HTTP Response Body)__: The body of the response received by a web client.\n3. __Meta Data (HTTP Headers)__: Gives information about the resource, like content-type, caching info.\n\nThis simple definition is the theoretical bedrock of this entire framework.\n\n## Getting Started\n\nLet's look at a simple example.\n\n```js\nasset = new rack.Asset({\n    url: '/hello.txt',\n    contents: 'hello world'\n})\n```\n\nNeed to serve that asset with a blisteringly fast in memory cache using express?\n\n```\napp.use(asset)\n```\n\n### Hash for speed and efficiency\n\nWhat's cool is that this new asset is available both here:\n\n```\n/hello.txt\n```\n\nAnd here\n\n```\n/hello-5eb63bbbe01eeed093cb22bb8f5acdc3.txt\n```\n\nThat long string of letters and numbers is the md5 hash of the contents.  If you hit the hash url, then we automatically set the HTTP cache to __never expire__.  \n\nNow proxies, browsers, cloud storage, content delivery networks only need to download your asset one single time.  You have versioning, conflict resolution all in one simple mechanism.  You can update your entire entire app instantaneously.  Fast, efficient, static.\n\n### One Rack to rule them All\n\nAssets need to be managed.  Enter the Rack.  A Rack serializes your assets, allows you to deploy to the cloud, and reference urls and tags in your templates.\n\nSay you have a directory structure like this:\n\n```\n/static      # all your images, fonts, etc.\n/style.less  # a less files with your styles\n```\n\nYou can create a Rack to put all your assets in.\n\n```js\nassets = new rack.Rack([\n    new rack.StaticAssets({\n        urlPrefix: '/static'\n        dirname: __dirname + '/static'\n    }),\n    new rack.LessAsset({\n        url: '/style.css'\n        filename: __dirname + '/style.less'\n    }\n])\n```\n\n### Use in your Templates\n\nAfter you hook into express, you can reference your assets in your server side templates.\n\n```js\nassets.tag('/style.css')\n```\n\nWhich gives you the html tag.\n\n```html\n<link href=\"/style-0f2j9fj039fuw0e9f23.css\" rel=\"stylesheet\">\n```\n\nOr you can grab just the url.\n\n```js\nassets.url('/logo.png')\n```\n\nWhich gives the hashed url.\n\n```\n/logo-34t90j0re9g034o4f3o4f3.png\n```\n\n# Batteries Included\n\nWe have some professional grade assets included.\n\n#### For Javascript\n* [Browserify](https://github.com/techpines/asset-rack/tree/master/lib#browserifyasset-jscoffeescript) - Create browserify assets that allow you to use \"node-style\" requires on the client-side.\n* [Snockets](https://github.com/techpines/asset-rack/tree/master/lib#snocketsasset-jscoffeescript) - Create snockets assets, to get the node-flavor of the \"sprockets\" from rails.\n\n#### For Stylesheets\n* [Less](http://github.com/techpines/asset-rack/tree/master/lib#lessasset) - Compile less assets, ability to use dependencies, minification.\n* [Stylus](https://github.com/techpines/asset-rack/tree/master/lib#stylusasset) - Compile stylu assets, ability to use dependencies, minification.\n\n#### Templates\n* [Jade](https://github.com/techpines/asset-rack/tree/master/lib#jadeasset) - High, performance jade templates precompiled for the browser.\n* [AngularTemplates](https://github.com/techpines/asset-rack/tree/master/lib#angulartemplatesasset) - AngularJS templates for you AngularJS folks.\n\n#### Static\n* [StaticAssets](https://github.com/techpines/asset-rack/tree/master/lib#staticassets) - Images(png, jpg, gif), fonts, whatever you got.\n\n## Roll your own\n\nAsset Rack is extremely flexible.  Extend the __Asset__ class and override the __create__ method to roll your own awesomeness, and watch them get automatically ka-pow'ed by your rack.\n\n```js\nSuperCoolAsset = rack.Asset.extend({\n    create: function(options) {\n        this.contents = 'easy, easy'\n        this.emit 'created'\n    }\n})\n```\nOr, for those with more refined taste:\n\n```coffee\nclass SuperCoolAsset extends rack.Asset\n    create: (options) ->\n        @contents = 'even easier with coffee'\n        @emit 'created'\n```\n\nCheckout the [tutorial.](https://github.com/techpines/asset-rack/tree/master/lib#extending-the-asset-class)\n\n\n## Deploying to the Cloud\nYour assets need to be deployed! Here are the current providers that are supported.\n\n### Amazon S3\n\n```js\nassets.deploy({\n    provider: 'amazon',\n    container: 'some-bucket',\n    accessKey: 'aws-access-key',\n    secretKey: 'aws-secret-key',\n}, function(error) {})\n```\n\n### Rackspace Cloud Files\n```js\nassets.deploy(\n    provider: 'rackspace',\n    container: 'some-container',\n    username: 'rackspace-username',\n    apiKey: 'rackspace-api-key',\n}, function(error) {})\n```\n\n### Azure Storage\n```js\nassets.deploy(\n    provider: 'azure',\n    container: 'some-container',\n    storageAccount: 'test-storage-account',\n    storageAccessKey: 'test-storage-access-key'\n}, function(error) {})\n```\n\n\n## FAQ\n\n#### __Why is this better than Connect-Assets?__\n\nThat's easy!\n\n* It works with node.js multi-process and cluster.\n* More built-in assets.\n* Un-opionated, connect-assets dictates your url structure AND directory structure.\n* Ability to deploy to the cloud.\n* Easy to extend.\n* Simpler to use.\n\nWith all that said, much thanks to Trevor for writing connect-assets. \n\n#### __Why is this better than Grunt?__\n\nGrunt is a great build tool.  Asset Rack is not a build a tool.  It never writes files to disk, there is no \"build step\".  Everything happens \"just in time\".\n\nIf you have \"genuine\" build issues, then by all means use Grunt.  You can even use Grunt with Asset Rack.\n\nHowever, if you are only using Grunt to manage your static assets, then you should consider upgrading to Asset Rack.\n\n#### __Why is this better than Wintersmith(Blacksmith)?__\n\nAsset Rack is a static web framework, and at it's core there are only two abstractions, the `Asset` and `Rack` classes.  Wintersmith is a high level framework that solves a more specific problem.\n\nWintersmith could consume Asset Rack as a dependency, and if something more high-level fits your specific use case, then by all means that is probably a good fit.  If you need more flexibilty and power, then go with Asset Rack.\n\n# License\n\n©2012 Brad Carleton, Tech Pines and available under the [MIT license](http://www.opensource.org/licenses/mit-license.php):\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","readmeFilename":"README.md","_id":"asset-rack@2.0.10","dist":{"shasum":"ccc014cf166f80676c1217fea3c32254ce785faf","tarball":"https://registry.npmjs.org/asset-rack/-/asset-rack-2.0.10.tgz","integrity":"sha512-JDaBS6fDTXNVn14TLxGnoB5yWL5xKEhhYgf8BHPZQ1PGoqJPs/+zeKokvAyzxCDNHe4FIcAs/n8PhGU0YqT1Rg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHd4BnmJBYKU0hlx5CA08wi9XWYdEy4jsq8eyCjQJp+3AiEA6KS4AUm6Zjwg6tviGVtgyDCG8j/RvGJUHq17oMtrEjY="}]},"_npmVersion":"1.1.65","_npmUser":{"name":"brad@techpines.com","email":"brad@techpines.com"},"maintainers":[{"name":"brad@techpines.com","email":"brad@techpines.com"}],"directories":{}},"2.0.11":{"name":"asset-rack","version":"2.0.11","description":"Static Web Framework for Nodejs","author":{"name":"Brad Carleton","email":"brad@techpines.com"},"repository":{"type":"git","url":"https://github.com/techpines/asset-rack"},"dependencies":{"browserify":"1.17.3","snockets":"1.3.8","uglify-js":"2.2.4","async":"0.1.22","pkgcloud":"0.6.6","less":"1.3.3","jade":"0.27.7","mime":"1.2.7","nib":"0.9.1","stylus":"0.32.0","underscore":"1.4.4","coffee-script":"1.4.0","markdown":"0.4.0"},"devDependencies":{"express.io":"1.1.8","request":"2.12.0","mocha":"1.8.1","chai":"1.4.2"},"scripts":{"test":"mocha --compilers coffee:coffee-script test/test.coffee --reporter spec --timeout 5000 --ignore-leaks","compile":"./node_modules/coffee-script/bin/coffee -o compiled/ -c lib/","prepublish":"echo $(pwd) > /tmp/.pwd; ./node_modules/coffee-script/bin/coffee -o compiled/ -c lib/;","postpublish":"rm -rf $(cat /tmp/.pwd)/compiled"},"main":"switch.js","engines":{"node":">= 0.5.0"},"readme":"\n<img src=\"https://s3.amazonaws.com/temp.techpines.com/asset-rack-white.png\">\n\n# The Static Web is here\n\nThe Static Web is __blisteringly fast__.  The Static Web is  __ultra efficient__.  The Static Web is __cutting edge__.  And now it has a hero.\n\n```coffeescript\nrack = require 'asset-rack'\n```\n\nThe Static Web is an incredibly modern, high-performance platform for delivering apps and services.  But before you dive-in, you need to start with the basics.  You need to understand the fundamental building block of the static web, the __asset__.\n\n\n## What is an Asset?\n\n> __An asset is a resource on the web that has the following three features:__\n\n1. __Location (URL)__: Where on the web the resource is located.\n2. __Contents (HTTP Response Body)__: The body of the response received by a web client.\n3. __Meta Data (HTTP Headers)__: Gives information about the resource, like content-type, caching info.\n\nThis simple definition is the theoretical bedrock of this entire framework.\n\n## Getting Started\n\nLet's look at a simple example.\n\n```js\nasset = new rack.Asset({\n    url: '/hello.txt',\n    contents: 'hello world'\n})\n```\n\nNeed to serve that asset with a blisteringly fast in memory cache using express?\n\n```\napp.use(asset)\n```\n\n### Hash for speed and efficiency\n\nWhat's cool is that this new asset is available both here:\n\n```\n/hello.txt\n```\n\nAnd here\n\n```\n/hello-5eb63bbbe01eeed093cb22bb8f5acdc3.txt\n```\n\nThat long string of letters and numbers is the md5 hash of the contents.  If you hit the hash url, then we automatically set the HTTP cache to __never expire__.  \n\nNow proxies, browsers, cloud storage, content delivery networks only need to download your asset one single time.  You have versioning, conflict resolution all in one simple mechanism.  You can update your entire entire app instantaneously.  Fast, efficient, static.\n\n### One Rack to rule them All\n\nAssets need to be managed.  Enter the Rack.  A Rack serializes your assets, allows you to deploy to the cloud, and reference urls and tags in your templates.\n\nSay you have a directory structure like this:\n\n```\n/static      # all your images, fonts, etc.\n/style.less  # a less files with your styles\n```\n\nYou can create a Rack to put all your assets in.\n\n```js\nassets = new rack.Rack([\n    new rack.StaticAssets({\n        urlPrefix: '/static'\n        dirname: __dirname + '/static'\n    }),\n    new rack.LessAsset({\n        url: '/style.css'\n        filename: __dirname + '/style.less'\n    }\n])\n```\n\n### Use in your Templates\n\nAfter you hook into express, you can reference your assets in your server side templates.\n\n```js\nassets.tag('/style.css')\n```\n\nWhich gives you the html tag.\n\n```html\n<link href=\"/style-0f2j9fj039fuw0e9f23.css\" rel=\"stylesheet\">\n```\n\nOr you can grab just the url.\n\n```js\nassets.url('/logo.png')\n```\n\nWhich gives the hashed url.\n\n```\n/logo-34t90j0re9g034o4f3o4f3.png\n```\n\n# Batteries Included\n\nWe have some professional grade assets included.\n\n#### For Javascript\n* [Browserify](https://github.com/techpines/asset-rack/tree/master/lib#browserifyasset-jscoffeescript) - Create browserify assets that allow you to use \"node-style\" requires on the client-side.\n* [Snockets](https://github.com/techpines/asset-rack/tree/master/lib#snocketsasset-jscoffeescript) - Create snockets assets, to get the node-flavor of the \"sprockets\" from rails.\n\n#### For Stylesheets\n* [Less](http://github.com/techpines/asset-rack/tree/master/lib#lessasset) - Compile less assets, ability to use dependencies, minification.\n* [Stylus](https://github.com/techpines/asset-rack/tree/master/lib#stylusasset) - Compile stylu assets, ability to use dependencies, minification.\n\n#### Templates\n* [Jade](https://github.com/techpines/asset-rack/tree/master/lib#jadeasset) - High, performance jade templates precompiled for the browser.\n* [AngularTemplates](https://github.com/techpines/asset-rack/tree/master/lib#angulartemplatesasset) - AngularJS templates for you AngularJS folks.\n\n#### Static\n* [StaticAssets](https://github.com/techpines/asset-rack/tree/master/lib#staticassets) - Images(png, jpg, gif), fonts, whatever you got.\n\n## Roll your own\n\nAsset Rack is extremely flexible.  Extend the __Asset__ class and override the __create__ method to roll your own awesomeness, and watch them get automatically ka-pow'ed by your rack.\n\n```js\nSuperCoolAsset = rack.Asset.extend({\n    create: function(options) {\n        this.contents = 'easy, easy'\n        this.emit 'created'\n    }\n})\n```\nOr, for those with more refined taste:\n\n```coffee\nclass SuperCoolAsset extends rack.Asset\n    create: (options) ->\n        @contents = 'even easier with coffee'\n        @emit 'created'\n```\n\nCheckout the [tutorial.](https://github.com/techpines/asset-rack/tree/master/lib#extending-the-asset-class)\n\n\n## Deploying to the Cloud\nYour assets need to be deployed! Here are the current providers that are supported.\n\n### Amazon S3\n\n```js\nassets.deploy({\n    provider: 'amazon',\n    container: 'some-bucket',\n    accessKey: 'aws-access-key',\n    secretKey: 'aws-secret-key',\n}, function(error) {})\n```\n\n### Rackspace Cloud Files\n```js\nassets.deploy(\n    provider: 'rackspace',\n    container: 'some-container',\n    username: 'rackspace-username',\n    apiKey: 'rackspace-api-key',\n}, function(error) {})\n```\n\n### Azure Storage\n```js\nassets.deploy(\n    provider: 'azure',\n    container: 'some-container',\n    storageAccount: 'test-storage-account',\n    storageAccessKey: 'test-storage-access-key'\n}, function(error) {})\n```\n\n\n## FAQ\n\n#### __Why is this better than Connect-Assets?__\n\nThat's easy!\n\n* It works with node.js multi-process and cluster.\n* More built-in assets.\n* Un-opionated, connect-assets dictates your url structure AND directory structure.\n* Ability to deploy to the cloud.\n* Easy to extend.\n* Simpler to use.\n\nWith all that said, much thanks to Trevor for writing connect-assets. \n\n#### __Why is this better than Grunt?__\n\nGrunt is a great build tool.  Asset Rack is not a build a tool.  It never writes files to disk, there is no \"build step\".  Everything happens \"just in time\".\n\nIf you have \"genuine\" build issues, then by all means use Grunt.  You can even use Grunt with Asset Rack.\n\nHowever, if you are only using Grunt to manage your static assets, then you should consider upgrading to Asset Rack.\n\n#### __Why is this better than Wintersmith(Blacksmith)?__\n\nAsset Rack is a static web framework, and at it's core there are only two abstractions, the `Asset` and `Rack` classes.  Wintersmith is a high level framework that solves a more specific problem.\n\nWintersmith could consume Asset Rack as a dependency, and if something more high-level fits your specific use case, then by all means that is probably a good fit.  If you need more flexibilty and power, then go with Asset Rack.\n\n# License\n\n©2012 Brad Carleton, Tech Pines and available under the [MIT license](http://www.opensource.org/licenses/mit-license.php):\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","readmeFilename":"README.md","_id":"asset-rack@2.0.11","dist":{"shasum":"e73345a20a98deacea0bc00a77ffe49c0c282cef","tarball":"https://registry.npmjs.org/asset-rack/-/asset-rack-2.0.11.tgz","integrity":"sha512-hDdDad29kWvhBgow7MjADS/8cAghnjUWs01PM25ghgEdQ00eAY8kH8pL4uj/H0T+hQOhH7S+tsVCEuOZlr3wpA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBM/7wjSUO/Q9LB4UXcaJLC5y5MUX6gNjacl9OAoZCeMAiBI/tTlM+cEwIV899KJgqAvn32yuDo7pj5y4+aCus8i9Q=="}]},"_npmVersion":"1.1.65","_npmUser":{"name":"brad@techpines.com","email":"brad@techpines.com"},"maintainers":[{"name":"brad@techpines.com","email":"brad@techpines.com"}],"directories":{}},"2.1.0":{"name":"asset-rack","version":"2.1.0","description":"Static Web Framework for Nodejs","author":{"name":"Brad Carleton","email":"brad@techpines.com"},"repository":{"type":"git","url":"https://github.com/techpines/asset-rack"},"dependencies":{"browserify":"1.17.3","snockets":"1.3.8","uglify-js":"2.2.4","async":"0.1.22","pkgcloud":"0.6.6","less":"1.3.3","jade":"0.27.7","mime":"1.2.7","nib":"0.9.1","stylus":"0.32.0","underscore":"1.4.4","coffee-script":"1.4.0","markdown":"0.4.0"},"devDependencies":{"express.io":"1.1.8","request":"2.12.0","mocha":"1.8.1","chai":"1.4.2"},"scripts":{"test":"mocha --compilers coffee:coffee-script test/test.coffee --reporter spec --timeout 5000 --ignore-leaks","compile":"./node_modules/coffee-script/bin/coffee -o compiled/ -c lib/","prepublish":"echo $(pwd) > /tmp/.pwd; ./node_modules/coffee-script/bin/coffee -o compiled/ -c lib/;","postpublish":"rm -rf $(cat /tmp/.pwd)/compiled"},"main":"switch.js","engines":{"node":">= 0.5.0"},"readme":"\n<img src=\"https://s3.amazonaws.com/temp.techpines.com/asset-rack-white.png\">\n\n# The Static Web is here\n\nThe Static Web is __blisteringly fast__.  The Static Web is  __ultra efficient__.  The Static Web is __cutting edge__.  And now it has a hero.\n\n```coffeescript\nrack = require 'asset-rack'\n```\n\nThe Static Web is an incredibly modern, high-performance platform for delivering apps and services.  But before you dive-in, you need to start with the basics.  You need to understand the fundamental building block of the static web, the __asset__.\n\n\n## What is an Asset?\n\n> __An asset is a resource on the web that has the following three features:__\n\n1. __Location (URL)__: Where on the web the resource is located.\n2. __Contents (HTTP Response Body)__: The body of the response received by a web client.\n3. __Meta Data (HTTP Headers)__: Gives information about the resource, like content-type, caching info.\n\nThis simple definition is the theoretical bedrock of this entire framework.\n\n## Getting Started\n\nLet's look at a simple example.\n\n```js\nasset = new rack.Asset({\n    url: '/hello.txt',\n    contents: 'hello world'\n})\n```\n\nNeed to serve that asset with a blisteringly fast in memory cache using express?\n\n```\napp.use(asset)\n```\n\n### Hash for speed and efficiency\n\nWhat's cool is that this new asset is available both here:\n\n```\n/hello.txt\n```\n\nAnd here\n\n```\n/hello-5eb63bbbe01eeed093cb22bb8f5acdc3.txt\n```\n\nThat long string of letters and numbers is the md5 hash of the contents.  If you hit the hash url, then we automatically set the HTTP cache to __never expire__.  \n\nNow proxies, browsers, cloud storage, content delivery networks only need to download your asset one single time.  You have versioning, conflict resolution all in one simple mechanism.  You can update your entire entire app instantaneously.  Fast, efficient, static.\n\n### One Rack to rule them All\n\nAssets need to be managed.  Enter the Rack.  A Rack serializes your assets, allows you to deploy to the cloud, and reference urls and tags in your templates.\n\nSay you have a directory structure like this:\n\n```\n/static      # all your images, fonts, etc.\n/style.less  # a less files with your styles\n```\n\nYou can create a Rack to put all your assets in.\n\n```js\nassets = new rack.Rack([\n    new rack.StaticAssets({\n        urlPrefix: '/static'\n        dirname: __dirname + '/static'\n    }),\n    new rack.LessAsset({\n        url: '/style.css'\n        filename: __dirname + '/style.less'\n    }\n])\n```\n\n### Use in your Templates\n\nAfter you hook into express, you can reference your assets in your server side templates.\n\n```js\nassets.tag('/style.css')\n```\n\nWhich gives you the html tag.\n\n```html\n<link href=\"/style-0f2j9fj039fuw0e9f23.css\" rel=\"stylesheet\">\n```\n\nOr you can grab just the url.\n\n```js\nassets.url('/logo.png')\n```\n\nWhich gives the hashed url.\n\n```\n/logo-34t90j0re9g034o4f3o4f3.png\n```\n\n# Batteries Included\n\nWe have some professional grade assets included.\n\n#### For Javascript\n* [Browserify](https://github.com/techpines/asset-rack/tree/master/lib#browserifyasset-jscoffeescript) - Create browserify assets that allow you to use \"node-style\" requires on the client-side.\n* [Snockets](https://github.com/techpines/asset-rack/tree/master/lib#snocketsasset-jscoffeescript) - Create snockets assets, to get the node-flavor of the \"sprockets\" from rails.\n\n#### For Stylesheets\n* [Less](http://github.com/techpines/asset-rack/tree/master/lib#lessasset) - Compile less assets, ability to use dependencies, minification.\n* [Stylus](https://github.com/techpines/asset-rack/tree/master/lib#stylusasset) - Compile stylu assets, ability to use dependencies, minification.\n\n#### Templates\n* [Jade](https://github.com/techpines/asset-rack/tree/master/lib#jadeasset) - High, performance jade templates precompiled for the browser.\n* [AngularTemplates](https://github.com/techpines/asset-rack/tree/master/lib#angulartemplatesasset) - AngularJS templates for you AngularJS folks.\n\n#### Static\n* [StaticAssets](https://github.com/techpines/asset-rack/tree/master/lib#staticassets) - Images(png, jpg, gif), fonts, whatever you got.\n\n## Roll your own\n\nAsset Rack is extremely flexible.  Extend the __Asset__ class and override the __create__ method to roll your own awesomeness, and watch them get automatically ka-pow'ed by your rack.\n\n```js\nSuperCoolAsset = rack.Asset.extend({\n    create: function(options) {\n        this.contents = 'easy, easy'\n        this.emit 'created'\n    }\n})\n```\nOr, for those with more refined taste:\n\n```coffee\nclass SuperCoolAsset extends rack.Asset\n    create: (options) ->\n        @contents = 'even easier with coffee'\n        @emit 'created'\n```\n\nCheckout the [tutorial.](https://github.com/techpines/asset-rack/tree/master/lib#extending-the-asset-class)\n\n\n## Deploying to the Cloud\nYour assets need to be deployed! Here are the current providers that are supported.\n\n### Amazon S3\n\n```js\nassets.deploy({\n    provider: 'amazon',\n    container: 'some-bucket',\n    accessKey: 'aws-access-key',\n    secretKey: 'aws-secret-key',\n}, function(error) {})\n```\n\n### Rackspace Cloud Files\n```js\nassets.deploy(\n    provider: 'rackspace',\n    container: 'some-container',\n    username: 'rackspace-username',\n    apiKey: 'rackspace-api-key',\n}, function(error) {})\n```\n\n### Azure Storage\n```js\nassets.deploy(\n    provider: 'azure',\n    container: 'some-container',\n    storageAccount: 'test-storage-account',\n    storageAccessKey: 'test-storage-access-key'\n}, function(error) {})\n```\n\n### Running in Production Mode\n\nIf you provide the options `configFile` in your deploy options then a config file will be written:\n\n```js\nassets.deploy(\n    configFile: __dirname + '/rack.json'\n    provider: 'amazon'\n    container: ...\n)\n```\n\nThen you can create your assets from the file like this:\n\n```js\nassets = rack.fromConfigFile({\n    configFile: __dirname + '/rack.json'\n    hostname: 'cdn.example.com'\n});\napp.use(assets);\n```\n\nAnd now all of your server side templates will reference your CDN.  Also, if you do happen to hit one of your static urls on the server, then you will be redirected to the CDN.\n\n## FAQ\n\n#### __Why is this better than Connect-Assets?__\n\nThat's easy!\n\n* It works with node.js multi-process and cluster.\n* More built-in assets.\n* Un-opionated, connect-assets dictates your url structure AND directory structure.\n* Ability to deploy to the cloud.\n* Easy to extend.\n* Simpler to use.\n\nWith all that said, much thanks to Trevor for writing connect-assets. \n\n#### __Why is this better than Grunt?__\n\nGrunt is a great build tool.  Asset Rack is not a build a tool.  It never writes files to disk, there is no \"build step\".  Everything happens \"just in time\".\n\nIf you have \"genuine\" build issues, then by all means use Grunt.  You can even use Grunt with Asset Rack.\n\nHowever, if you are only using Grunt to manage your static assets, then you should consider upgrading to Asset Rack.\n\n#### __Why is this better than Wintersmith(Blacksmith)?__\n\nAsset Rack is a static web framework, and at it's core there are only two abstractions, the `Asset` and `Rack` classes.  Wintersmith is a high level framework that solves a more specific problem.\n\nWintersmith could consume Asset Rack as a dependency, and if something more high-level fits your specific use case, then by all means that is probably a good fit.  If you need more flexibilty and power, then go with Asset Rack.\n\n# License\n\n©2012 Brad Carleton, Tech Pines and available under the [MIT license](http://www.opensource.org/licenses/mit-license.php):\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","readmeFilename":"README.md","_id":"asset-rack@2.1.0","dist":{"shasum":"79144f7ea2e6681bad8d0d924bf3af41160ba905","tarball":"https://registry.npmjs.org/asset-rack/-/asset-rack-2.1.0.tgz","integrity":"sha512-4hUBc9voZOzCJDatL9TBbWglEQIIKHXZ1XycqCKSHnGruz/5kgwpawilxaOZy/PCl486Nkm0IEMrVi87IBqbVA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDs0jlLGtzSgeS8j6lgSO1io1WktYEm+tiJfgsRMYIgYQIgHETRxcQCdmSTuxJG7KzoNRtMZzT7lC3RIEibTYl9cco="}]},"_npmVersion":"1.1.65","_npmUser":{"name":"brad@techpines.com","email":"brad@techpines.com"},"maintainers":[{"name":"brad@techpines.com","email":"brad@techpines.com"}],"directories":{}},"2.1.1":{"name":"asset-rack","version":"2.1.1","description":"Static Web Framework for Nodejs","author":{"name":"Brad Carleton","email":"brad@techpines.com"},"repository":{"type":"git","url":"https://github.com/techpines/asset-rack"},"dependencies":{"browserify":"1.17.3","snockets":"1.3.8","uglify-js":"2.2.4","async":"0.1.22","pkgcloud":"0.6.6","less":"1.3.3","jade":"0.27.7","mime":"1.2.7","nib":"0.9.1","stylus":"0.32.0","underscore":"1.4.4","coffee-script":"1.4.0","markdown":"0.4.0"},"devDependencies":{"express.io":"1.1.8","request":"2.12.0","mocha":"1.8.1","chai":"1.4.2"},"scripts":{"test":"./node_modules/mocha/bin/mocha --compilers coffee:coffee-script test/test.coffee --reporter spec --timeout 5000 --ignore-leaks","compile":"./node_modules/coffee-script/bin/coffee -o compiled/ -c lib/","prepublish":"echo $(pwd) > /tmp/.pwd; ./node_modules/coffee-script/bin/coffee -o compiled/ -c lib/;","postpublish":"rm -rf $(cat /tmp/.pwd)/compiled"},"main":"switch.js","engines":{"node":">= 0.5.0"},"readme":"\n<img src=\"https://s3.amazonaws.com/temp.techpines.com/asset-rack-white.png\">\n\n# The Static Web is here\n\nThe Static Web is __blisteringly fast__.  The Static Web is  __ultra efficient__.  The Static Web is __cutting edge__.  And now it has a hero.\n\n```coffeescript\nrack = require 'asset-rack'\n```\n\nThe Static Web is an incredibly modern, high-performance platform for delivering apps and services.  But before you dive-in, you need to start with the basics.  You need to understand the fundamental building block of the static web, the __asset__.\n\n\n## What is an Asset?\n\n> __An asset is a resource on the web that has the following three features:__\n\n1. __Location (URL)__: Where on the web the resource is located.\n2. __Contents (HTTP Response Body)__: The body of the response received by a web client.\n3. __Meta Data (HTTP Headers)__: Gives information about the resource, like content-type, caching info.\n\nThis simple definition is the theoretical bedrock of this entire framework.\n\n## Getting Started\n\nLet's look at a simple example.\n\n```js\nasset = new rack.Asset({\n    url: '/hello.txt',\n    contents: 'hello world'\n})\n```\n\nNeed to serve that asset with a blisteringly fast in memory cache using express?\n\n```\napp.use(asset)\n```\n\n### Hash for speed and efficiency\n\nWhat's cool is that this new asset is available both here:\n\n```\n/hello.txt\n```\n\nAnd here\n\n```\n/hello-5eb63bbbe01eeed093cb22bb8f5acdc3.txt\n```\n\nThat long string of letters and numbers is the md5 hash of the contents.  If you hit the hash url, then we automatically set the HTTP cache to __never expire__.  \n\nNow proxies, browsers, cloud storage, content delivery networks only need to download your asset one single time.  You have versioning, conflict resolution all in one simple mechanism.  You can update your entire entire app instantaneously.  Fast, efficient, static.\n\n### One Rack to rule them All\n\nAssets need to be managed.  Enter the Rack.  A Rack serializes your assets, allows you to deploy to the cloud, and reference urls and tags in your templates.\n\nSay you have a directory structure like this:\n\n```\n/static      # all your images, fonts, etc.\n/style.less  # a less files with your styles\n```\n\nYou can create a Rack to put all your assets in.\n\n```js\nassets = new rack.Rack([\n    new rack.StaticAssets({\n        urlPrefix: '/static'\n        dirname: __dirname + '/static'\n    }),\n    new rack.LessAsset({\n        url: '/style.css'\n        filename: __dirname + '/style.less'\n    }\n])\n```\n\n### Use in your Templates\n\nAfter you hook into express, you can reference your assets in your server side templates.\n\n```js\nassets.tag('/style.css')\n```\n\nWhich gives you the html tag.\n\n```html\n<link href=\"/style-0f2j9fj039fuw0e9f23.css\" rel=\"stylesheet\">\n```\n\nOr you can grab just the url.\n\n```js\nassets.url('/logo.png')\n```\n\nWhich gives the hashed url.\n\n```\n/logo-34t90j0re9g034o4f3o4f3.png\n```\n\n# Batteries Included\n\nWe have some professional grade assets included.\n\n#### For Javascript\n* [Browserify](https://github.com/techpines/asset-rack/tree/master/lib#browserifyasset-jscoffeescript) - Create browserify assets that allow you to use \"node-style\" requires on the client-side.\n* [Snockets](https://github.com/techpines/asset-rack/tree/master/lib#snocketsasset-jscoffeescript) - Create snockets assets, to get the node-flavor of the \"sprockets\" from rails.\n\n#### For Stylesheets\n* [Less](http://github.com/techpines/asset-rack/tree/master/lib#lessasset) - Compile less assets, ability to use dependencies, minification.\n* [Stylus](https://github.com/techpines/asset-rack/tree/master/lib#stylusasset) - Compile stylu assets, ability to use dependencies, minification.\n\n#### Templates\n* [Jade](https://github.com/techpines/asset-rack/tree/master/lib#jadeasset) - High, performance jade templates precompiled for the browser.\n* [AngularTemplates](https://github.com/techpines/asset-rack/tree/master/lib#angulartemplatesasset) - AngularJS templates for you AngularJS folks.\n\n#### Static\n* [StaticAssets](https://github.com/techpines/asset-rack/tree/master/lib#staticassets) - Images(png, jpg, gif), fonts, whatever you got.\n\n## Roll your own\n\nAsset Rack is extremely flexible.  Extend the __Asset__ class and override the __create__ method to roll your own awesomeness, and watch them get automatically ka-pow'ed by your rack.\n\n```js\nSuperCoolAsset = rack.Asset.extend({\n    create: function(options) {\n        this.contents = 'easy, easy'\n        this.emit 'created'\n    }\n})\n```\nOr, for those with more refined taste:\n\n```coffee\nclass SuperCoolAsset extends rack.Asset\n    create: (options) ->\n        @contents = 'even easier with coffee'\n        @emit 'created'\n```\n\nCheckout the [tutorial.](https://github.com/techpines/asset-rack/tree/master/lib#extending-the-asset-class)\n\n\n## Deploying to the Cloud\nYour assets need to be deployed! Here are the current providers that are supported.\n\n### Amazon S3\n\n```js\nassets.deploy({\n    provider: 'amazon',\n    container: 'some-bucket',\n    accessKey: 'aws-access-key',\n    secretKey: 'aws-secret-key',\n}, function(error) {})\n```\n\n### Rackspace Cloud Files\n```js\nassets.deploy(\n    provider: 'rackspace',\n    container: 'some-container',\n    username: 'rackspace-username',\n    apiKey: 'rackspace-api-key',\n}, function(error) {})\n```\n\n### Azure Storage\n```js\nassets.deploy(\n    provider: 'azure',\n    container: 'some-container',\n    storageAccount: 'test-storage-account',\n    storageAccessKey: 'test-storage-access-key'\n}, function(error) {})\n```\n\n### Running in Production Mode\n\nIf you provide the options `configFile` in your deploy options then a config file will be written:\n\n```js\nassets.deploy(\n    configFile: __dirname + '/rack.json'\n    provider: 'amazon'\n    container: ...\n)\n```\n\nThen you can create your assets from the file like this:\n\n```js\nassets = rack.fromConfigFile({\n    configFile: __dirname + '/rack.json'\n    hostname: 'cdn.example.com'\n});\napp.use(assets);\n```\n\nAnd now all of your server side templates will reference your CDN.  Also, if you do happen to hit one of your static urls on the server, then you will be redirected to the CDN.\n\n## FAQ\n\n#### __Why is this better than Connect-Assets?__\n\nThat's easy!\n\n* It works with node.js multi-process and cluster.\n* More built-in assets.\n* Un-opionated, connect-assets dictates your url structure AND directory structure.\n* Ability to deploy to the cloud.\n* Easy to extend.\n* Simpler to use.\n\nWith all that said, much thanks to Trevor for writing connect-assets. \n\n#### __Why is this better than Grunt?__\n\nGrunt is a great build tool.  Asset Rack is not a build a tool.  It never writes files to disk, there is no \"build step\".  Everything happens \"just in time\".\n\nIf you have \"genuine\" build issues, then by all means use Grunt.  You can even use Grunt with Asset Rack.\n\nHowever, if you are only using Grunt to manage your static assets, then you should consider upgrading to Asset Rack.\n\n#### __Why is this better than Wintersmith(Blacksmith)?__\n\nAsset Rack is a static web framework, and at it's core there are only two abstractions, the `Asset` and `Rack` classes.  Wintersmith is a high level framework that solves a more specific problem.\n\nWintersmith could consume Asset Rack as a dependency, and if something more high-level fits your specific use case, then by all means that is probably a good fit.  If you need more flexibilty and power, then go with Asset Rack.\n\n# License\n\n©2012 Brad Carleton, Tech Pines and available under the [MIT license](http://www.opensource.org/licenses/mit-license.php):\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","readmeFilename":"README.md","_id":"asset-rack@2.1.1","dist":{"shasum":"6b3a3e25cc25166f015d5062975193bb5dcde380","tarball":"https://registry.npmjs.org/asset-rack/-/asset-rack-2.1.1.tgz","integrity":"sha512-Bz5XSfNtDM1jpZNwpRJ7S61hbYrsOfIGka4Ws7IOZN1OROXvcwJ3ZvZt8OFuIO07GGhbS/isOh4p4Z6l05qo3Q==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDk4bUIbT1AYKTlKSqQ4pT9hKFQewWjeJSHUoCrMfUBjAIhAJAJf/Jy9Rlk52HCLUVdUmXA831zETn01mAClwyNLV6c"}]},"_npmVersion":"1.1.65","_npmUser":{"name":"brad@techpines.com","email":"brad@techpines.com"},"maintainers":[{"name":"brad@techpines.com","email":"brad@techpines.com"}],"directories":{}},"2.1.2":{"name":"asset-rack","version":"2.1.2","description":"Static Web Framework for Nodejs","author":{"name":"Brad Carleton","email":"brad@techpines.com"},"repository":{"type":"git","url":"https://github.com/techpines/asset-rack"},"dependencies":{"browserify":"1.17.3","snockets":"1.3.8","uglify-js":"2.2.4","async":"0.1.22","pkgcloud":"0.6.6","less":"1.3.3","jade":"0.27.7","mime":"1.2.7","nib":"0.9.1","stylus":"0.32.0","underscore":"1.4.4","coffee-script":"1.4.0","markdown":"0.4.0"},"devDependencies":{"express.io":"1.1.8","request":"2.12.0","mocha":"1.8.1","chai":"1.4.2"},"scripts":{"test":"./node_modules/mocha/bin/mocha --compilers coffee:coffee-script test/test.coffee --reporter spec --timeout 5000 --ignore-leaks","compile":"./node_modules/coffee-script/bin/coffee -o compiled/ -c lib/","prepublish":"echo $(pwd) > /tmp/.pwd; ./node_modules/coffee-script/bin/coffee -o compiled/ -c lib/;","postpublish":"rm -rf $(cat /tmp/.pwd)/compiled"},"main":"switch.js","engines":{"node":">= 0.5.0"},"readme":"\n<img src=\"https://s3.amazonaws.com/temp.techpines.com/asset-rack-white.png\">\n\n# The Static Web is here\n\nThe Static Web is __blisteringly fast__.  The Static Web is  __ultra efficient__.  The Static Web is __cutting edge__.  And now it has a hero.\n\n```coffeescript\nrack = require 'asset-rack'\n```\n\nThe Static Web is an incredibly modern, high-performance platform for delivering apps and services.  But before you dive-in, you need to start with the basics.  You need to understand the fundamental building block of the static web, the __asset__.\n\n\n## What is an Asset?\n\n> __An asset is a resource on the web that has the following three features:__\n\n1. __Location (URL)__: Where on the web the resource is located.\n2. __Contents (HTTP Response Body)__: The body of the response received by a web client.\n3. __Meta Data (HTTP Headers)__: Gives information about the resource, like content-type, caching info.\n\nThis simple definition is the theoretical bedrock of this entire framework.\n\n## Getting Started\n\nLet's look at a simple example.\n\n```js\nasset = new rack.Asset({\n    url: '/hello.txt',\n    contents: 'hello world'\n})\n```\n\nNeed to serve that asset with a blisteringly fast in memory cache using express?\n\n```\napp.use(asset)\n```\n\n### Hash for speed and efficiency\n\nWhat's cool is that this new asset is available both here:\n\n```\n/hello.txt\n```\n\nAnd here\n\n```\n/hello-5eb63bbbe01eeed093cb22bb8f5acdc3.txt\n```\n\nThat long string of letters and numbers is the md5 hash of the contents.  If you hit the hash url, then we automatically set the HTTP cache to __never expire__.  \n\nNow proxies, browsers, cloud storage, content delivery networks only need to download your asset one single time.  You have versioning, conflict resolution all in one simple mechanism.  You can update your entire entire app instantaneously.  Fast, efficient, static.\n\n### One Rack to rule them All\n\nAssets need to be managed.  Enter the Rack.  A Rack serializes your assets, allows you to deploy to the cloud, and reference urls and tags in your templates.\n\nSay you have a directory structure like this:\n\n```\n/static      # all your images, fonts, etc.\n/style.less  # a less files with your styles\n```\n\nYou can create a Rack to put all your assets in.\n\n```js\nassets = new rack.Rack([\n    new rack.StaticAssets({\n        urlPrefix: '/static'\n        dirname: __dirname + '/static'\n    }),\n    new rack.LessAsset({\n        url: '/style.css'\n        filename: __dirname + '/style.less'\n    }\n])\n```\n\n### Use in your Templates\n\nAfter you hook into express, you can reference your assets in your server side templates.\n\n```js\nassets.tag('/style.css')\n```\n\nWhich gives you the html tag.\n\n```html\n<link href=\"/style-0f2j9fj039fuw0e9f23.css\" rel=\"stylesheet\">\n```\n\nOr you can grab just the url.\n\n```js\nassets.url('/logo.png')\n```\n\nWhich gives the hashed url.\n\n```\n/logo-34t90j0re9g034o4f3o4f3.png\n```\n\n# Batteries Included\n\nWe have some professional grade assets included.\n\n#### For Javascript\n* [Browserify](https://github.com/techpines/asset-rack/tree/master/lib#browserifyasset-jscoffeescript) - Create browserify assets that allow you to use \"node-style\" requires on the client-side.\n* [Snockets](https://github.com/techpines/asset-rack/tree/master/lib#snocketsasset-jscoffeescript) - Create snockets assets, to get the node-flavor of the \"sprockets\" from rails.\n\n#### For Stylesheets\n* [Less](http://github.com/techpines/asset-rack/tree/master/lib#lessasset) - Compile less assets, ability to use dependencies, minification.\n* [Stylus](https://github.com/techpines/asset-rack/tree/master/lib#stylusasset) - Compile stylu assets, ability to use dependencies, minification.\n\n#### Templates\n* [Jade](https://github.com/techpines/asset-rack/tree/master/lib#jadeasset) - High, performance jade templates precompiled for the browser.\n* [AngularTemplates](https://github.com/techpines/asset-rack/tree/master/lib#angulartemplatesasset) - AngularJS templates for you AngularJS folks.\n\n#### Static\n* [StaticAssets](https://github.com/techpines/asset-rack/tree/master/lib#staticassets) - Images(png, jpg, gif), fonts, whatever you got.\n\n## Roll your own\n\nAsset Rack is extremely flexible.  Extend the __Asset__ class and override the __create__ method to roll your own awesomeness, and watch them get automatically ka-pow'ed by your rack.\n\n```js\nSuperCoolAsset = rack.Asset.extend({\n    create: function(options) {\n        this.contents = 'easy, easy'\n        this.emit 'created'\n    }\n})\n```\nOr, for those with more refined taste:\n\n```coffee\nclass SuperCoolAsset extends rack.Asset\n    create: (options) ->\n        @contents = 'even easier with coffee'\n        @emit 'created'\n```\n\nCheckout the [tutorial.](https://github.com/techpines/asset-rack/tree/master/lib#extending-the-asset-class)\n\n\n## Deploying to the Cloud\nYour assets need to be deployed! Here are the current providers that are supported.\n\n### Amazon S3\n\n```js\nassets.deploy({\n    provider: 'amazon',\n    container: 'some-bucket',\n    accessKey: 'aws-access-key',\n    secretKey: 'aws-secret-key',\n}, function(error) {})\n```\n\n### Rackspace Cloud Files\n```js\nassets.deploy(\n    provider: 'rackspace',\n    container: 'some-container',\n    username: 'rackspace-username',\n    apiKey: 'rackspace-api-key',\n}, function(error) {})\n```\n\n### Azure Storage\n```js\nassets.deploy(\n    provider: 'azure',\n    container: 'some-container',\n    storageAccount: 'test-storage-account',\n    storageAccessKey: 'test-storage-access-key'\n}, function(error) {})\n```\n\n### Running in Production Mode\n\nIf you provide the options `configFile` in your deploy options then a config file will be written:\n\n```js\nassets.deploy(\n    configFile: __dirname + '/rack.json'\n    provider: 'amazon'\n    container: ...\n)\n```\n\nThen you can create your assets from the file like this:\n\n```js\nassets = rack.fromConfigFile({\n    configFile: __dirname + '/rack.json'\n    hostname: 'cdn.example.com'\n});\napp.use(assets);\n```\n\nAnd now all of your server side templates will reference your CDN.  Also, if you do happen to hit one of your static urls on the server, then you will be redirected to the CDN.\n\n## FAQ\n\n#### __Why is this better than Connect-Assets?__\n\nThat's easy!\n\n* It works with node.js multi-process and cluster.\n* More built-in assets.\n* Un-opionated, connect-assets dictates your url structure AND directory structure.\n* Ability to deploy to the cloud.\n* Easy to extend.\n* Simpler to use.\n\nWith all that said, much thanks to Trevor for writing connect-assets. \n\n#### __Why is this better than Grunt?__\n\nGrunt is a great build tool.  Asset Rack is not a build a tool.  It never writes files to disk, there is no \"build step\".  Everything happens \"just in time\".\n\nIf you have \"genuine\" build issues, then by all means use Grunt.  You can even use Grunt with Asset Rack.\n\nHowever, if you are only using Grunt to manage your static assets, then you should consider upgrading to Asset Rack.\n\n#### __Why is this better than Wintersmith(Blacksmith)?__\n\nAsset Rack is a static web framework, and at it's core there are only two abstractions, the `Asset` and `Rack` classes.  Wintersmith is a high level framework that solves a more specific problem.\n\nWintersmith could consume Asset Rack as a dependency, and if something more high-level fits your specific use case, then by all means that is probably a good fit.  If you need more flexibilty and power, then go with Asset Rack.\n\n# Changelog\n\n### 2.1.2\n\n* Added ability to configure Stylus, thanks to @noc7c9.\n\n```coffee\nnew StylusAsset\n  url: '/style.css'\n  filename: __dirname + '/style/fun.styl'\n  config: ->\n    @use bootstrap()\n    @define 'setting', 90\n```\n\nAnd for javascript:\n\n```js\nnew StylusAsset({\n  url: '/style.css',\n  filename: __dirname + '/style/fun.styl',\n  config: function (stylus) {\n    stylus // using \"this\" here seems a little unnatural\n      .use(bootstrap())\n      .define('setting', 90);\n  }\n});\n```\n\n# License\n\n©2012 Brad Carleton, Tech Pines and available under the [MIT license](http://www.opensource.org/licenses/mit-license.php):\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","readmeFilename":"README.md","_id":"asset-rack@2.1.2","dist":{"shasum":"c2c0bba3fadc881338881ebc92ad7a90ed195365","tarball":"https://registry.npmjs.org/asset-rack/-/asset-rack-2.1.2.tgz","integrity":"sha512-7jM6jl9hq5LuJMoiWqSlMFD9mX6HmW2N4ZlqwbB2jCppfSg/DSZudVEfa0E/7AZqFEzF62+oxC6p6SCDG/xF+A==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCPumyuPmbepO0/r2BzHPvrh1/HyJ65YwK7Sy9ehRDpWQIhAN0HsH4HdoLlO+yVXMvDjzFFoGDVEWtTIx2gVQB6RvbT"}]},"_npmVersion":"1.1.65","_npmUser":{"name":"brad@techpines.com","email":"brad@techpines.com"},"maintainers":[{"name":"brad@techpines.com","email":"brad@techpines.com"}],"directories":{}},"2.1.3":{"name":"asset-rack","version":"2.1.3","description":"Static Web Framework for Nodejs","author":{"name":"Brad Carleton","email":"brad@techpines.com"},"repository":{"type":"git","url":"https://github.com/techpines/asset-rack"},"dependencies":{"browserify":"1.17.3","snockets":"1.3.8","uglify-js":"2.2.4","async":"0.1.22","pkgcloud":"0.6.6","less":"1.3.3","jade":"0.27.7","mime":"1.2.7","nib":"0.9.1","stylus":"0.32.0","underscore":"1.4.4","coffee-script":"1.4.0","markdown":"0.4.0","node-sassy":"0.0.1"},"devDependencies":{"express.io":"1.1.8","request":"2.12.0","mocha":"1.8.1","chai":"1.4.2"},"scripts":{"test":"./node_modules/mocha/bin/mocha test/test.coffee","compile":"./node_modules/coffee-script/bin/coffee -o compiled/ -c lib/","prepublish":"echo $(pwd) > /tmp/.pwd; ./node_modules/coffee-script/bin/coffee -o compiled/ -c lib/;","postpublish":"rm -rf $(cat /tmp/.pwd)/compiled"},"main":"switch.js","engines":{"node":">= 0.5.0"},"readme":"\n<img src=\"https://s3.amazonaws.com/temp.techpines.com/asset-rack-white.png\">\n\n# The Static Web is here\n\nThe Static Web is __blisteringly fast__.  The Static Web is  __ultra efficient__.  The Static Web is __cutting edge__.  And now it has a hero.\n\n```coffeescript\nrack = require 'asset-rack'\n```\n\nThe Static Web is an incredibly modern, high-performance platform for delivering apps and services.  But before you dive-in, you need to start with the basics.  You need to understand the fundamental building block of the static web, the __asset__.\n\n\n## What is an Asset?\n\n> __An asset is a resource on the web that has the following three features:__\n\n1. __Location (URL)__: Where on the web the resource is located.\n2. __Contents (HTTP Response Body)__: The body of the response received by a web client.\n3. __Meta Data (HTTP Headers)__: Gives information about the resource, like content-type, caching info.\n\nThis simple definition is the theoretical bedrock of this entire framework.\n\n## Getting Started\n\nLet's look at a simple example.\n\n```js\nasset = new rack.Asset({\n    url: '/hello.txt',\n    contents: 'hello world'\n})\n```\n\nNeed to serve that asset with a blisteringly fast in memory cache using express?\n\n```\napp.use(asset)\n```\n\n### Hash for speed and efficiency\n\nWhat's cool is that this new asset is available both here:\n\n```\n/hello.txt\n```\n\nAnd here\n\n```\n/hello-5eb63bbbe01eeed093cb22bb8f5acdc3.txt\n```\n\nThat long string of letters and numbers is the md5 hash of the contents.  If you hit the hash url, then we automatically set the HTTP cache to __never expire__.  \n\nNow proxies, browsers, cloud storage, content delivery networks only need to download your asset one single time.  You have versioning, conflict resolution all in one simple mechanism.  You can update your entire entire app instantaneously.  Fast, efficient, static.\n\n### One Rack to rule them All\n\nAssets need to be managed.  Enter the Rack.  A Rack serializes your assets, allows you to deploy to the cloud, and reference urls and tags in your templates.\n\nSay you have a directory structure like this:\n\n```\n/static      # all your images, fonts, etc.\n/style.less  # a less files with your styles\n```\n\nYou can create a Rack to put all your assets in.\n\n```js\nassets = new rack.Rack([\n    new rack.StaticAssets({\n        urlPrefix: '/static'\n        dirname: __dirname + '/static'\n    }),\n    new rack.LessAsset({\n        url: '/style.css'\n        filename: __dirname + '/style.less'\n    }\n])\n```\n\n### Use in your Templates\n\nAfter you hook into express, you can reference your assets in your server side templates.\n\n```js\nassets.tag('/style.css')\n```\n\nWhich gives you the html tag.\n\n```html\n<link href=\"/style-0f2j9fj039fuw0e9f23.css\" rel=\"stylesheet\">\n```\n\nOr you can grab just the url.\n\n```js\nassets.url('/logo.png')\n```\n\nWhich gives the hashed url.\n\n```\n/logo-34t90j0re9g034o4f3o4f3.png\n```\n\n# Batteries Included\n\nWe have some professional grade assets included.\n\n#### For Javascript\n* [Browserify](https://github.com/techpines/asset-rack/tree/master/lib#browserifyasset-jscoffeescript) - Create browserify assets that allow you to use \"node-style\" requires on the client-side.\n* [Snockets](https://github.com/techpines/asset-rack/tree/master/lib#snocketsasset-jscoffeescript) - Create snockets assets, to get the node-flavor of the \"sprockets\" from rails.\n\n#### For Stylesheets\n* [Less](http://github.com/techpines/asset-rack/tree/master/lib#lessasset) - Compile less assets, ability to use dependencies, minification.\n* [Stylus](https://github.com/techpines/asset-rack/tree/master/lib#stylusasset) - Compile stylu assets, ability to use dependencies, minification.\n\n#### Templates\n* [Jade](https://github.com/techpines/asset-rack/tree/master/lib#jadeasset) - High, performance jade templates precompiled for the browser.\n* [AngularTemplates](https://github.com/techpines/asset-rack/tree/master/lib#angulartemplatesasset) - AngularJS templates for you AngularJS folks.\n\n#### Other\n* [StaticAssets](https://github.com/techpines/asset-rack/tree/master/lib#staticassets) - Images(png, jpg, gif), fonts, whatever you got.\n* [DynamicAssets](https://github.com/techpines/asset-rack/tree/master/lib#dynamicassets) - For compiling file-based assets like Less or Stylus in an entire directory.\n\n## Roll your own\n\nAsset Rack is extremely flexible.  Extend the __Asset__ class and override the __create__ method to roll your own awesomeness, and watch them get automatically ka-pow'ed by your rack.\n\n```js\nSuperCoolAsset = rack.Asset.extend({\n    create: function(options) {\n        this.contents = 'easy, easy'\n        this.emit 'created'\n    }\n})\n```\nOr, for those with more refined taste:\n\n```coffee\nclass SuperCoolAsset extends rack.Asset\n    create: (options) ->\n        @contents = 'even easier with coffee'\n        @emit 'created'\n```\n\nCheckout the [tutorial.](https://github.com/techpines/asset-rack/tree/master/lib#extending-the-asset-class)\n\n\n## Deploying to the Cloud\nYour assets need to be deployed! Here are the current providers that are supported.\n\n### Amazon S3\n\n```js\nassets.deploy({\n    provider: 'amazon',\n    container: 'some-bucket',\n    accessKey: 'aws-access-key',\n    secretKey: 'aws-secret-key',\n}, function(error) {})\n```\n\n### Rackspace Cloud Files\n```js\nassets.deploy(\n    provider: 'rackspace',\n    container: 'some-container',\n    username: 'rackspace-username',\n    apiKey: 'rackspace-api-key',\n}, function(error) {})\n```\n\n### Azure Storage\n```js\nassets.deploy(\n    provider: 'azure',\n    container: 'some-container',\n    storageAccount: 'test-storage-account',\n    storageAccessKey: 'test-storage-access-key'\n}, function(error) {})\n```\n\n### Running in Production Mode\n\nIf you provide the options `configFile` in your deploy options then a config file will be written:\n\n```js\nassets.deploy(\n    configFile: __dirname + '/rack.json'\n    provider: 'amazon'\n    container: ...\n)\n```\n\nThen you can create your assets from the file like this:\n\n```js\nassets = rack.fromConfigFile({\n    configFile: __dirname + '/rack.json'\n    hostname: 'cdn.example.com'\n});\napp.use(assets);\n```\n\nAnd now all of your server side templates will reference your CDN.  Also, if you do happen to hit one of your static urls on the server, then you will be redirected to the CDN.\n\n## FAQ\n\n#### __Why is this better than Connect-Assets?__\n\nThat's easy!\n\n* It works with node.js multi-process and cluster.\n* More built-in assets.\n* Un-opionated, connect-assets dictates your url structure AND directory structure.\n* Ability to deploy to the cloud.\n* Easy to extend.\n* Simpler to use.\n\nWith all that said, much thanks to Trevor for writing connect-assets. \n\n#### __Why is this better than Grunt?__\n\nGrunt is a great build tool.  Asset Rack is not a build a tool.  It never writes files to disk, there is no \"build step\".  Everything happens \"just in time\".\n\nIf you have \"genuine\" build issues, then by all means use Grunt.  You can even use Grunt with Asset Rack.\n\nHowever, if you are only using Grunt to manage your static assets, then you should consider upgrading to Asset Rack.\n\n#### __Why is this better than Wintersmith(Blacksmith)?__\n\nAsset Rack is a static web framework, and at it's core there are only two abstractions, the `Asset` and `Rack` classes.  Wintersmith is a high level framework that solves a more specific problem.\n\nWintersmith could consume Asset Rack as a dependency, and if something more high-level fits your specific use case, then by all means that is probably a good fit.  If you need more flexibilty and power, then go with Asset Rack.\n\n# Changelog\n\n### 2.1.3\n\n* @noc7c9 Added generalized `rack.util.walk` function, need to document the function.\n* @noc7c9 Added `DynamicAssets` class.\n* @noc7c9 is awesome.\n\n### 2.1.2\n\n* Added ability to configure Stylus, thanks to @noc7c9.\n\n```coffee\nnew StylusAsset\n  url: '/style.css'\n  filename: __dirname + '/style/fun.styl'\n  config: ->\n    @use bootstrap()\n    @define 'setting', 90\n```\n\nAnd for javascript:\n\n```js\nnew StylusAsset({\n  url: '/style.css',\n  filename: __dirname + '/style/fun.styl',\n  config: function (stylus) {\n    stylus // using \"this\" here seems a little unnatural\n      .use(bootstrap())\n      .define('setting', 90);\n  }\n});\n```\n\n# Test\n\nTesting is easy and fun!\n\n```js\ncd asset-rack\nnpm install\nnpm test\n```\n\n# License\n\n©2012 Brad Carleton, Tech Pines and available under the [MIT license](http://www.opensource.org/licenses/mit-license.php):\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","readmeFilename":"README.md","_id":"asset-rack@2.1.3","dist":{"shasum":"ffe4e1964eb98a3f80708a377a3f6c11b91ad01e","tarball":"https://registry.npmjs.org/asset-rack/-/asset-rack-2.1.3.tgz","integrity":"sha512-ANu7wpebVy4PmHSpVXbMvDnGvMnw+/KH6qEaTjZbLETXhjoi2xjlTnWyVdj7G19WhXutleRnBNkNBIueeT4XxA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDLNVPyv1WujIYDm8E70IZ4owwaZBu0mfdrfz9CwRounQIgO9Eq1uk2kpeZksKDSCBN+mYDzJZtphwJnpAXuvJ10YU="}]},"_npmVersion":"1.1.65","_npmUser":{"name":"brad@techpines.com","email":"brad@techpines.com"},"maintainers":[{"name":"brad@techpines.com","email":"brad@techpines.com"}],"directories":{}},"2.1.4":{"name":"asset-rack","version":"2.1.4","description":"Static Web Framework for Nodejs","author":{"name":"Brad Carleton","email":"brad@techpines.com"},"repository":{"type":"git","url":"https://github.com/techpines/asset-rack"},"dependencies":{"browserify":"1.17.3","snockets":"1.3.8","uglify-js":"2.2.4","async":"0.1.22","pkgcloud":"0.6.6","less":"1.3.3","jade":"0.27.7","mime":"1.2.7","nib":"0.9.1","stylus":"0.32.0","underscore":"1.4.4","coffee-script":"1.4.0","markdown":"0.4.0","node-sassy":"0.0.1"},"devDependencies":{"express.io":"1.1.8","request":"2.12.0","mocha":"1.8.1","chai":"1.4.2"},"scripts":{"test":"./node_modules/mocha/bin/mocha test/test.coffee","compile":"./node_modules/coffee-script/bin/coffee -o compiled/ -c lib/","prepublish":"echo $(pwd) > /tmp/.pwd; ./node_modules/coffee-script/bin/coffee -o compiled/ -c lib/;","postpublish":"rm -rf $(cat /tmp/.pwd)/compiled"},"main":"switch.js","engines":{"node":">= 0.5.0"},"readme":"\n<img src=\"https://s3.amazonaws.com/temp.techpines.com/asset-rack-white.png\">\n\n# The Static Web is here\n\nThe Static Web is __blisteringly fast__.  The Static Web is  __ultra efficient__.  The Static Web is __cutting edge__.  And now it has a hero.\n\n```coffeescript\nrack = require 'asset-rack'\n```\n\nThe Static Web is an incredibly modern, high-performance platform for delivering apps and services.  But before you dive-in, you need to start with the basics.  You need to understand the fundamental building block of the static web, the __asset__.\n\n\n## What is an Asset?\n\n> __An asset is a resource on the web that has the following three features:__\n\n1. __Location (URL)__: Where on the web the resource is located.\n2. __Contents (HTTP Response Body)__: The body of the response received by a web client.\n3. __Meta Data (HTTP Headers)__: Gives information about the resource, like content-type, caching info.\n\nThis simple definition is the theoretical bedrock of this entire framework.\n\n## Getting Started\n\nLet's look at a simple example.\n\n```js\nasset = new rack.Asset({\n    url: '/hello.txt',\n    contents: 'hello world'\n})\n```\n\nNeed to serve that asset with a blisteringly fast in memory cache using express?\n\n```\napp.use(asset)\n```\n\n### Hash for speed and efficiency\n\nWhat's cool is that this new asset is available both here:\n\n```\n/hello.txt\n```\n\nAnd here\n\n```\n/hello-5eb63bbbe01eeed093cb22bb8f5acdc3.txt\n```\n\nThat long string of letters and numbers is the md5 hash of the contents.  If you hit the hash url, then we automatically set the HTTP cache to __never expire__.  \n\nNow proxies, browsers, cloud storage, content delivery networks only need to download your asset one single time.  You have versioning, conflict resolution all in one simple mechanism.  You can update your entire entire app instantaneously.  Fast, efficient, static.\n\n### One Rack to rule them All\n\nAssets need to be managed.  Enter the Rack.  A Rack serializes your assets, allows you to deploy to the cloud, and reference urls and tags in your templates.\n\nSay you have a directory structure like this:\n\n```\n/static      # all your images, fonts, etc.\n/style.less  # a less files with your styles\n```\n\nYou can create a Rack to put all your assets in.\n\n```js\nassets = new rack.Rack([\n    new rack.StaticAssets({\n        urlPrefix: '/static'\n        dirname: __dirname + '/static'\n    }),\n    new rack.LessAsset({\n        url: '/style.css'\n        filename: __dirname + '/style.less'\n    }\n])\n```\n\n### Use in your Templates\n\nAfter you hook into express, you can reference your assets in your server side templates.\n\n```js\nassets.tag('/style.css')\n```\n\nWhich gives you the html tag.\n\n```html\n<link href=\"/style-0f2j9fj039fuw0e9f23.css\" rel=\"stylesheet\">\n```\n\nOr you can grab just the url.\n\n```js\nassets.url('/logo.png')\n```\n\nWhich gives the hashed url.\n\n```\n/logo-34t90j0re9g034o4f3o4f3.png\n```\n\n# Batteries Included\n\nWe have some professional grade assets included.\n\n#### For Javascript\n* [Browserify](https://github.com/techpines/asset-rack/tree/master/lib#browserifyasset-jscoffeescript) - Create browserify assets that allow you to use \"node-style\" requires on the client-side.\n* [Snockets](https://github.com/techpines/asset-rack/tree/master/lib#snocketsasset-jscoffeescript) - Create snockets assets, to get the node-flavor of the \"sprockets\" from rails.\n\n#### For Stylesheets\n* [Less](http://github.com/techpines/asset-rack/tree/master/lib#lessasset) - Compile less assets, ability to use dependencies, minification.\n* [Stylus](https://github.com/techpines/asset-rack/tree/master/lib#stylusasset) - Compile stylu assets, ability to use dependencies, minification.\n\n#### Templates\n* [Jade](https://github.com/techpines/asset-rack/tree/master/lib#jadeasset) - High, performance jade templates precompiled for the browser.\n* [AngularTemplates](https://github.com/techpines/asset-rack/tree/master/lib#angulartemplatesasset) - AngularJS templates for you AngularJS folks.\n\n#### Other\n* [StaticAssets](https://github.com/techpines/asset-rack/tree/master/lib#staticassets) - Images(png, jpg, gif), fonts, whatever you got.\n* [DynamicAssets](https://github.com/techpines/asset-rack/tree/master/lib#dynamicassets) - For compiling file-based assets like Less or Stylus in an entire directory.\n\n## Roll your own\n\nAsset Rack is extremely flexible.  Extend the __Asset__ class and override the __create__ method to roll your own awesomeness, and watch them get automatically ka-pow'ed by your rack.\n\n```js\nSuperCoolAsset = rack.Asset.extend({\n    create: function(options) {\n        this.contents = 'easy, easy'\n        this.emit 'created'\n    }\n})\n```\nOr, for those with more refined taste:\n\n```coffee\nclass SuperCoolAsset extends rack.Asset\n    create: (options) ->\n        @contents = 'even easier with coffee'\n        @emit 'created'\n```\n\nCheckout the [tutorial.](https://github.com/techpines/asset-rack/tree/master/lib#extending-the-asset-class)\n\n\n## Deploying to the Cloud\nYour assets need to be deployed! Here are the current providers that are supported.\n\n### Amazon S3\n\n```js\nassets.deploy({\n    provider: 'amazon',\n    container: 'some-bucket',\n    accessKey: 'aws-access-key',\n    secretKey: 'aws-secret-key',\n}, function(error) {})\n```\n\n### Rackspace Cloud Files\n```js\nassets.deploy(\n    provider: 'rackspace',\n    container: 'some-container',\n    username: 'rackspace-username',\n    apiKey: 'rackspace-api-key',\n}, function(error) {})\n```\n\n### Azure Storage\n```js\nassets.deploy(\n    provider: 'azure',\n    container: 'some-container',\n    storageAccount: 'test-storage-account',\n    storageAccessKey: 'test-storage-access-key'\n}, function(error) {})\n```\n\n### Running in Production Mode\n\nIf you provide the options `configFile` in your deploy options then a config file will be written:\n\n```js\nassets.deploy(\n    configFile: __dirname + '/rack.json'\n    provider: 'amazon'\n    container: ...\n)\n```\n\nThen you can create your assets from the file like this:\n\n```js\nassets = rack.fromConfigFile({\n    configFile: __dirname + '/rack.json'\n    hostname: 'cdn.example.com'\n});\napp.use(assets);\n```\n\nAnd now all of your server side templates will reference your CDN.  Also, if you do happen to hit one of your static urls on the server, then you will be redirected to the CDN.\n\n## FAQ\n\n#### __Why is this better than Connect-Assets?__\n\nThat's easy!\n\n* It works with node.js multi-process and cluster.\n* More built-in assets.\n* Un-opionated, connect-assets dictates your url structure AND directory structure.\n* Ability to deploy to the cloud.\n* Easy to extend.\n* Simpler to use.\n\nWith all that said, much thanks to Trevor for writing connect-assets. \n\n#### __Why is this better than Grunt?__\n\nGrunt is a great build tool.  Asset Rack is not a build a tool.  It never writes files to disk, there is no \"build step\".  Everything happens \"just in time\".\n\nIf you have \"genuine\" build issues, then by all means use Grunt.  You can even use Grunt with Asset Rack.\n\nHowever, if you are only using Grunt to manage your static assets, then you should consider upgrading to Asset Rack.\n\n#### __Why is this better than Wintersmith(Blacksmith)?__\n\nAsset Rack is a static web framework, and at it's core there are only two abstractions, the `Asset` and `Rack` classes.  Wintersmith is a high level framework that solves a more specific problem.\n\nWintersmith could consume Asset Rack as a dependency, and if something more high-level fits your specific use case, then by all means that is probably a good fit.  If you need more flexibilty and power, then go with Asset Rack.\n\n# Changelog\n\n### 2.1.3\n\n* @noc7c9 Added generalized `rack.util.walk` function, need to document the function.\n* @noc7c9 Added `DynamicAssets` class.\n* @noc7c9 is awesome.\n\n### 2.1.2\n\n* Added ability to configure Stylus, thanks to @noc7c9.\n\n```coffee\nnew StylusAsset\n  url: '/style.css'\n  filename: __dirname + '/style/fun.styl'\n  config: ->\n    @use bootstrap()\n    @define 'setting', 90\n```\n\nAnd for javascript:\n\n```js\nnew StylusAsset({\n  url: '/style.css',\n  filename: __dirname + '/style/fun.styl',\n  config: function (stylus) {\n    stylus // using \"this\" here seems a little unnatural\n      .use(bootstrap())\n      .define('setting', 90);\n  }\n});\n```\n\n# Test\n\nTesting is easy and fun!\n\n```js\ncd asset-rack\nnpm install\nnpm test\n```\n\n# License\n\n©2012 Brad Carleton, Tech Pines and available under the [MIT license](http://www.opensource.org/licenses/mit-license.php):\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","readmeFilename":"README.md","_id":"asset-rack@2.1.4","dist":{"shasum":"741ab58a73d8beea90d4d6359e6ef0ef3d6fdecf","tarball":"https://registry.npmjs.org/asset-rack/-/asset-rack-2.1.4.tgz","integrity":"sha512-kZ6YHhiyionEkD8qJ/V2l99SGe/LnXKqp6LoA5tqllHzAKU6Fwn6cT+7I9xOdEvp77bFziDwJMKPZ23cvoQCCw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDdDDNmpEDKwrDL4VaXCYSucCqqCnHs2KZGTT/auxvmcAiBRtPbXj7oYZh8cKW6Ppg3GP4V7SDuo+Ra39glSwtmB7g=="}]},"_npmVersion":"1.1.65","_npmUser":{"name":"brad@techpines.com","email":"brad@techpines.com"},"maintainers":[{"name":"brad@techpines.com","email":"brad@techpines.com"}],"directories":{}},"2.1.5":{"name":"asset-rack","version":"2.1.5","description":"Static Web Framework for Nodejs","author":{"name":"Brad Carleton","email":"brad@techpines.com"},"repository":{"type":"git","url":"https://github.com/techpines/asset-rack"},"dependencies":{"browserify":"1.17.3","snockets":"1.3.8","uglify-js":"2.2.4","async":"0.1.22","pkgcloud":"0.6.6","less":"1.3.3","jade":"0.27.7","mime":"1.2.7","nib":"0.9.1","stylus":"0.32.0","underscore":"1.4.4","coffee-script":"1.4.0","markdown":"0.4.0","node-sassy":"0.0.1"},"devDependencies":{"express.io":"1.1.8","request":"2.12.0","mocha":"1.8.1","chai":"1.4.2"},"scripts":{"test":"./node_modules/mocha/bin/mocha test/test.coffee","compile":"./node_modules/coffee-script/bin/coffee -o compiled/ -c lib/","prepublish":"echo $(pwd) > /tmp/.pwd; ./node_modules/coffee-script/bin/coffee -o compiled/ -c lib/;","postpublish":"rm -rf $(cat /tmp/.pwd)/compiled"},"main":"switch.js","engines":{"node":">= 0.5.0"},"readme":"\n<img src=\"https://s3.amazonaws.com/temp.techpines.com/asset-rack-white.png\">\n\n# The Static Web is here\n\nThe Static Web is __blisteringly fast__.  The Static Web is  __ultra efficient__.  The Static Web is __cutting edge__.  And now it has a hero.\n\n```coffeescript\nrack = require 'asset-rack'\n```\n\nThe Static Web is an incredibly modern, high-performance platform for delivering apps and services.  But before you dive-in, you need to start with the basics.  You need to understand the fundamental building block of the static web, the __asset__.\n\n\n## What is an Asset?\n\n> __An asset is a resource on the web that has the following three features:__\n\n1. __Location (URL)__: Where on the web the resource is located.\n2. __Contents (HTTP Response Body)__: The body of the response received by a web client.\n3. __Meta Data (HTTP Headers)__: Gives information about the resource, like content-type, caching info.\n\nThis simple definition is the theoretical bedrock of this entire framework.\n\n## Getting Started\n\nLet's look at a simple example.\n\n```js\nasset = new rack.Asset({\n    url: '/hello.txt',\n    contents: 'hello world'\n})\n```\n\nNeed to serve that asset with a blisteringly fast in memory cache using express?\n\n```\napp.use(asset)\n```\n\n### Hash for speed and efficiency\n\nWhat's cool is that this new asset is available both here:\n\n```\n/hello.txt\n```\n\nAnd here\n\n```\n/hello-5eb63bbbe01eeed093cb22bb8f5acdc3.txt\n```\n\nThat long string of letters and numbers is the md5 hash of the contents.  If you hit the hash url, then we automatically set the HTTP cache to __never expire__.  \n\nNow proxies, browsers, cloud storage, content delivery networks only need to download your asset one single time.  You have versioning, conflict resolution all in one simple mechanism.  You can update your entire entire app instantaneously.  Fast, efficient, static.\n\n### One Rack to rule them All\n\nAssets need to be managed.  Enter the Rack.  A Rack serializes your assets, allows you to deploy to the cloud, and reference urls and tags in your templates.\n\nSay you have a directory structure like this:\n\n```\n/static      # all your images, fonts, etc.\n/style.less  # a less files with your styles\n```\n\nYou can create a Rack to put all your assets in.\n\n```js\nassets = new rack.Rack([\n    new rack.StaticAssets({\n        urlPrefix: '/static'\n        dirname: __dirname + '/static'\n    }),\n    new rack.LessAsset({\n        url: '/style.css'\n        filename: __dirname + '/style.less'\n    }\n])\n```\n\n### Use in your Templates\n\nAfter you hook into express, you can reference your assets in your server side templates.\n\n```js\nassets.tag('/style.css')\n```\n\nWhich gives you the html tag.\n\n```html\n<link href=\"/style-0f2j9fj039fuw0e9f23.css\" rel=\"stylesheet\">\n```\n\nOr you can grab just the url.\n\n```js\nassets.url('/logo.png')\n```\n\nWhich gives the hashed url.\n\n```\n/logo-34t90j0re9g034o4f3o4f3.png\n```\n\n# Batteries Included\n\nWe have some professional grade assets included.\n\n#### For Javascript\n* [Browserify](https://github.com/techpines/asset-rack/tree/master/lib#browserifyasset-jscoffeescript) - Create browserify assets that allow you to use \"node-style\" requires on the client-side.\n* [Snockets](https://github.com/techpines/asset-rack/tree/master/lib#snocketsasset-jscoffeescript) - Create snockets assets, to get the node-flavor of the \"sprockets\" from rails.\n\n#### For Stylesheets\n* [Less](http://github.com/techpines/asset-rack/tree/master/lib#lessasset) - Compile less assets, ability to use dependencies, minification.\n* [Stylus](https://github.com/techpines/asset-rack/tree/master/lib#stylusasset) - Compile stylu assets, ability to use dependencies, minification.\n\n#### Templates\n* [Jade](https://github.com/techpines/asset-rack/tree/master/lib#jadeasset) - High, performance jade templates precompiled for the browser.\n* [AngularTemplates](https://github.com/techpines/asset-rack/tree/master/lib#angulartemplatesasset) - AngularJS templates for you AngularJS folks.\n\n#### Other\n* [StaticAssets](https://github.com/techpines/asset-rack/tree/master/lib#staticassets) - Images(png, jpg, gif), fonts, whatever you got.\n* [DynamicAssets](https://github.com/techpines/asset-rack/tree/master/lib#dynamicassets) - For compiling file-based assets like Less or Stylus in an entire directory.\n\n## Roll your own\n\nAsset Rack is extremely flexible.  Extend the __Asset__ class and override the __create__ method to roll your own awesomeness, and watch them get automatically ka-pow'ed by your rack.\n\n```js\nSuperCoolAsset = rack.Asset.extend({\n    create: function(options) {\n        this.contents = 'easy, easy'\n        this.emit 'created'\n    }\n})\n```\nOr, for those with more refined taste:\n\n```coffee\nclass SuperCoolAsset extends rack.Asset\n    create: (options) ->\n        @contents = 'even easier with coffee'\n        @emit 'created'\n```\n\nCheckout the [tutorial.](https://github.com/techpines/asset-rack/tree/master/lib#extending-the-asset-class)\n\n\n## Deploying to the Cloud\nYour assets need to be deployed! Here are the current providers that are supported.\n\n### Amazon S3\n\n```js\nassets.deploy({\n    provider: 'amazon',\n    container: 'some-bucket',\n    accessKey: 'aws-access-key',\n    secretKey: 'aws-secret-key',\n}, function(error) {})\n```\n\n### Rackspace Cloud Files\n```js\nassets.deploy(\n    provider: 'rackspace',\n    container: 'some-container',\n    username: 'rackspace-username',\n    apiKey: 'rackspace-api-key',\n}, function(error) {})\n```\n\n### Azure Storage\n```js\nassets.deploy(\n    provider: 'azure',\n    container: 'some-container',\n    storageAccount: 'test-storage-account',\n    storageAccessKey: 'test-storage-access-key'\n}, function(error) {})\n```\n\n### Running in Production Mode\n\nIf you provide the options `configFile` in your deploy options then a config file will be written:\n\n```js\nassets.deploy(\n    configFile: __dirname + '/rack.json'\n    provider: 'amazon'\n    container: ...\n)\n```\n\nThen you can create your assets from the file like this:\n\n```js\nassets = rack.fromConfigFile({\n    configFile: __dirname + '/rack.json'\n    hostname: 'cdn.example.com'\n});\napp.use(assets);\n```\n\nAnd now all of your server side templates will reference your CDN.  Also, if you do happen to hit one of your static urls on the server, then you will be redirected to the CDN.\n\n## FAQ\n\n#### __Why is this better than Connect-Assets?__\n\nThat's easy!\n\n* It works with node.js multi-process and cluster.\n* More built-in assets.\n* Un-opionated, connect-assets dictates your url structure AND directory structure.\n* Ability to deploy to the cloud.\n* Easy to extend.\n* Simpler to use.\n\nWith all that said, much thanks to Trevor for writing connect-assets. \n\n#### __Why is this better than Grunt?__\n\nGrunt is a great build tool.  Asset Rack is not a build a tool.  It never writes files to disk, there is no \"build step\".  Everything happens \"just in time\".\n\nIf you have \"genuine\" build issues, then by all means use Grunt.  You can even use Grunt with Asset Rack.\n\nHowever, if you are only using Grunt to manage your static assets, then you should consider upgrading to Asset Rack.\n\n#### __Why is this better than Wintersmith(Blacksmith)?__\n\nAsset Rack is a static web framework, and at it's core there are only two abstractions, the `Asset` and `Rack` classes.  Wintersmith is a high level framework that solves a more specific problem.\n\nWintersmith could consume Asset Rack as a dependency, and if something more high-level fits your specific use case, then by all means that is probably a good fit.  If you need more flexibilty and power, then go with Asset Rack.\n\n# Changelog\n\n### 2.1.4\n\n* @vicapow Better error handling for `LessAsset`.\n\n### 2.1.3\n\n* @noc7c9 Added generalized `rack.util.walk` function, need to document the function.\n* @noc7c9 Added `DynamicAssets` class.\n* @noc7c9 is awesome.\n\n### 2.1.2\n\n* Added ability to configure Stylus, thanks to @noc7c9.\n\n```coffee\nnew StylusAsset\n  url: '/style.css'\n  filename: __dirname + '/style/fun.styl'\n  config: ->\n    @use bootstrap()\n    @define 'setting', 90\n```\n\nAnd for javascript:\n\n```js\nnew StylusAsset({\n  url: '/style.css',\n  filename: __dirname + '/style/fun.styl',\n  config: function (stylus) {\n    stylus // using \"this\" here seems a little unnatural\n      .use(bootstrap())\n      .define('setting', 90);\n  }\n});\n```\n\n# Test\n\nTesting is easy and fun!\n\n```js\ncd asset-rack\nnpm install\nnpm test\n```\n\n# License\n\n©2012 Brad Carleton, Tech Pines and available under the [MIT license](http://www.opensource.org/licenses/mit-license.php):\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","readmeFilename":"README.md","_id":"asset-rack@2.1.5","dist":{"shasum":"dae245d01398ebe19f148cb60744dc6a72b379b8","tarball":"https://registry.npmjs.org/asset-rack/-/asset-rack-2.1.5.tgz","integrity":"sha512-9Ge/z/wUlPQKfBdpV318x3ErnESEeZNCXRzHU46Mg9qTsGDCE+tWD65Lx5AfAlWPCn1kl/6dL/Xkuu1gCGD8Rg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEwHS5gwR+F2zjEGlyVNiuQRv78r4DkebNKzcZIe+MpeAiEA/+V/PzM9wQvEtGRglMldHIBwnZTxMEoRF9XJtWgb9ew="}]},"_npmVersion":"1.1.65","_npmUser":{"name":"brad@techpines.com","email":"brad@techpines.com"},"maintainers":[{"name":"brad@techpines.com","email":"brad@techpines.com"}],"directories":{}},"2.2.0":{"name":"asset-rack","version":"2.2.0","description":"Static Web Framework for Nodejs","author":{"name":"Brad Carleton","email":"brad@techpines.com"},"repository":{"type":"git","url":"https://github.com/techpines/asset-rack"},"dependencies":{"browserify":"1.17.3","snockets":">=1.3.8","uglify-js":">=2.2.4","async":"0.1.22","pkgcloud":"0.6.6","less":">=1.3.3","jade":">=0.28.2","mime":"1.2.7","nib":">=0.9.1","stylus":">=0.32.0","underscore":"1.4.4","coffee-script":">=1.6.2","markdown":"0.4.0","node-sassy":"0.0.1"},"devDependencies":{"express.io":"1.1.8","request":"2.12.0","mocha":"1.8.1","chai":"1.4.2"},"scripts":{"test":"./node_modules/mocha/bin/mocha test/test.coffee","compile":"./node_modules/coffee-script/bin/coffee -o compiled/ -c lib/","prepublish":"echo $(pwd) > /tmp/.pwd; ./node_modules/coffee-script/bin/coffee -o compiled/ -c lib/;","postpublish":"rm -rf $(cat /tmp/.pwd)/compiled"},"main":"switch.js","engines":{"node":">= 0.5.0"},"readme":"\n<img src=\"https://s3.amazonaws.com/temp.techpines.com/asset-rack-white.png\">\n\n# The Static Web is here\n\nThe Static Web is __blisteringly fast__.  The Static Web is  __ultra efficient__.  The Static Web is __cutting edge__.  And now it has a hero.\n\n```coffeescript\nrack = require 'asset-rack'\n```\n\nThe Static Web is an incredibly modern, high-performance platform for delivering apps and services.  But before you dive-in, you need to start with the basics.  You need to understand the fundamental building block of the static web, the __asset__.\n\n\n## What is an Asset?\n\n> __An asset is a resource on the web that has the following three features:__\n\n1. __Location (URL)__: Where on the web the resource is located.\n2. __Contents (HTTP Response Body)__: The body of the response received by a web client.\n3. __Meta Data (HTTP Headers)__: Gives information about the resource, like content-type, caching info.\n\nThis simple definition is the theoretical bedrock of this entire framework.\n\n## Getting Started\n\nLet's look at a simple example.\n\n```js\nasset = new rack.Asset({\n    url: '/hello.txt',\n    contents: 'hello world'\n})\n```\n\nNeed to serve that asset with a blisteringly fast in memory cache using express?\n\n```\napp.use(asset)\n```\n\n### Hash for speed and efficiency\n\nWhat's cool is that this new asset is available both here:\n\n```\n/hello.txt\n```\n\nAnd here\n\n```\n/hello-5eb63bbbe01eeed093cb22bb8f5acdc3.txt\n```\n\nThat long string of letters and numbers is the md5 hash of the contents.  If you hit the hash url, then we automatically set the HTTP cache to __never expire__.  \n\nNow proxies, browsers, cloud storage, content delivery networks only need to download your asset one single time.  You have versioning, conflict resolution all in one simple mechanism.  You can update your entire entire app instantaneously.  Fast, efficient, static.\n\n### One Rack to rule them All\n\nAssets need to be managed.  Enter the Rack.  A Rack serializes your assets, allows you to deploy to the cloud, and reference urls and tags in your templates.\n\nSay you have a directory structure like this:\n\n```\n/static      # all your images, fonts, etc.\n/style.less  # a less files with your styles\n```\n\nYou can create a Rack to put all your assets in.\n\n```js\nassets = new rack.Rack([\n    new rack.StaticAssets({\n        urlPrefix: '/static'\n        dirname: __dirname + '/static'\n    }),\n    new rack.LessAsset({\n        url: '/style.css'\n        filename: __dirname + '/style.less'\n    }\n])\n```\n\n### Use in your Templates\n\nAfter you hook into express, you can reference your assets in your server side templates.\n\n```js\nassets.tag('/style.css')\n```\n\nWhich gives you the html tag.\n\n```html\n<link href=\"/style-0f2j9fj039fuw0e9f23.css\" rel=\"stylesheet\">\n```\n\nOr you can grab just the url.\n\n```js\nassets.url('/logo.png')\n```\n\nWhich gives the hashed url.\n\n```\n/logo-34t90j0re9g034o4f3o4f3.png\n```\n\n# Batteries Included\n\nWe have some professional grade assets included.\n\n#### For Javascript\n* [Browserify](https://github.com/techpines/asset-rack/tree/master/lib#browserifyasset-jscoffeescript) - Create browserify assets that allow you to use \"node-style\" requires on the client-side.\n* [Snockets](https://github.com/techpines/asset-rack/tree/master/lib#snocketsasset-jscoffeescript) - Create snockets assets, to get the node-flavor of the \"sprockets\" from rails.\n\n#### For Stylesheets\n* [Less](http://github.com/techpines/asset-rack/tree/master/lib#lessasset) - Compile less assets, ability to use dependencies, minification.\n* [Stylus](https://github.com/techpines/asset-rack/tree/master/lib#stylusasset) - Compile stylu assets, ability to use dependencies, minification.\n\n#### Templates\n* [Jade](https://github.com/techpines/asset-rack/tree/master/lib#jadeasset) - High, performance jade templates precompiled for the browser.\n* [AngularTemplates](https://github.com/techpines/asset-rack/tree/master/lib#angulartemplatesasset) - AngularJS templates for you AngularJS folks.\n\n#### Other\n* [StaticAssets](https://github.com/techpines/asset-rack/tree/master/lib#staticassets) - Images(png, jpg, gif), fonts, whatever you got.\n* [DynamicAssets](https://github.com/techpines/asset-rack/tree/master/lib#dynamicassets) - For compiling file-based assets like Less or Stylus in an entire directory.\n\n## Roll your own\n\nAsset Rack is extremely flexible.  Extend the __Asset__ class and override the __create__ method to roll your own awesomeness, and watch them get automatically ka-pow'ed by your rack.\n\n```js\nSuperCoolAsset = rack.Asset.extend({\n    create: function(options) {\n        this.contents = 'easy, easy'\n        this.emit 'created'\n    }\n})\n```\nOr, for those with more refined taste:\n\n```coffee\nclass SuperCoolAsset extends rack.Asset\n    create: (options) ->\n        @contents = 'even easier with coffee'\n        @emit 'created'\n```\n\nCheckout the [tutorial.](https://github.com/techpines/asset-rack/tree/master/lib#extending-the-asset-class)\n\n\n## Deploying to the Cloud\nYour assets need to be deployed! Here are the current providers that are supported.\n\n### Amazon S3\n\n```js\nassets.deploy({\n    provider: 'amazon',\n    container: 'some-bucket',\n    accessKey: 'aws-access-key',\n    secretKey: 'aws-secret-key',\n}, function(error) {})\n```\n\n### Rackspace Cloud Files\n```js\nassets.deploy(\n    provider: 'rackspace',\n    container: 'some-container',\n    username: 'rackspace-username',\n    apiKey: 'rackspace-api-key',\n}, function(error) {})\n```\n\n### Azure Storage\n```js\nassets.deploy(\n    provider: 'azure',\n    container: 'some-container',\n    storageAccount: 'test-storage-account',\n    storageAccessKey: 'test-storage-access-key'\n}, function(error) {})\n```\n\n### Running in Production Mode\n\nIf you provide the options `configFile` in your deploy options then a config file will be written:\n\n```js\nassets.deploy(\n    configFile: __dirname + '/rack.json'\n    provider: 'amazon'\n    container: ...\n)\n```\n\nThen you can create your assets from the file like this:\n\n```js\nassets = rack.fromConfigFile({\n    configFile: __dirname + '/rack.json'\n    hostname: 'cdn.example.com'\n});\napp.use(assets);\n```\n\nAnd now all of your server side templates will reference your CDN.  Also, if you do happen to hit one of your static urls on the server, then you will be redirected to the CDN.\n\n## FAQ\n\n#### __Why is this better than Connect-Assets?__\n\nThat's easy!\n\n* It works with node.js multi-process and cluster.\n* More built-in assets.\n* Un-opionated, connect-assets dictates your url structure AND directory structure.\n* Ability to deploy to the cloud.\n* Easy to extend.\n* Simpler to use.\n\nWith all that said, much thanks to Trevor for writing connect-assets. \n\n#### __Why is this better than Grunt?__\n\nGrunt is a great build tool.  Asset Rack is not a build a tool.  It never writes files to disk, there is no \"build step\".  Everything happens \"just in time\".\n\nIf you have \"genuine\" build issues, then by all means use Grunt.  You can even use Grunt with Asset Rack.\n\nHowever, if you are only using Grunt to manage your static assets, then you should consider upgrading to Asset Rack.\n\n#### __Why is this better than Wintersmith(Blacksmith)?__\n\nAsset Rack is a static web framework, and at it's core there are only two abstractions, the `Asset` and `Rack` classes.  Wintersmith is a high level framework that solves a more specific problem.\n\nWintersmith could consume Asset Rack as a dependency, and if something more high-level fits your specific use case, then by all means that is probably a good fit.  If you need more flexibilty and power, then go with Asset Rack.\n\n# Changelog\n\n### 2.2.0\n\n* Watch and asset recreation is now working.  This should be considered experimental for this version.\n\n```js\nnew StylusAsset({\n    watch: true,\n    ...\n});\n```\n\n* Gzip is here finally.\n\n```js\nnew BrowserifyAsset({\n    gzip: true,\n    ...\n});\n```\n\n* Now adding sub assets to an asset is much simpler, just use `addAsset`.\n\n```js\nthis.addAsset(asset);\nthis.emit('created');\n```\n\nThanks @moellenbeck, @d1plo1d, @undashes, and @noc7c9 for contributing!\n\n### 2.1.4\n\n* @vicapow Better error handling for `LessAsset`.\n\n### 2.1.3\n\n* @noc7c9 Added generalized `rack.util.walk` function, need to document the function.\n* @noc7c9 Added `DynamicAssets` class.\n* @noc7c9 is awesome.\n\n### 2.1.2\n\n* Added ability to configure Stylus, thanks to @noc7c9.\n\n```coffee\nnew StylusAsset\n  url: '/style.css'\n  filename: __dirname + '/style/fun.styl'\n  config: ->\n    @use bootstrap()\n    @define 'setting', 90\n```\n\nAnd for javascript:\n\n```js\nnew StylusAsset({\n  url: '/style.css',\n  filename: __dirname + '/style/fun.styl',\n  config: function (stylus) {\n    stylus // using \"this\" here seems a little unnatural\n      .use(bootstrap())\n      .define('setting', 90);\n  }\n});\n```\n\n# Test\n\nTesting is easy and fun!\n\n```js\ncd asset-rack\nnpm install\nnpm test\n```\n\n# License\n\n©2012 Brad Carleton, Tech Pines and available under the [MIT license](http://www.opensource.org/licenses/mit-license.php):\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","readmeFilename":"README.md","_id":"asset-rack@2.2.0","dist":{"shasum":"912955654241c8e223c41f4b31afa89d10cc41ae","tarball":"https://registry.npmjs.org/asset-rack/-/asset-rack-2.2.0.tgz","integrity":"sha512-qJR5eSGg6iEDGTus4NHxpcKV677UXGD8u+2axQc12cibIYj4JzbTlAOdGFddhhJvutfjbGhfYB3KKDp5G3I8Ag==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBwPKtvi6yxMQNuox7XtAmI93GcJa4koABi5HJJ3miIpAiBErzb8FLV5Nq7hyHsWeEVn2fasBUt2TEzG7DcdPtj6yg=="}]},"_npmVersion":"1.1.65","_npmUser":{"name":"brad@techpines.com","email":"brad@techpines.com"},"maintainers":[{"name":"brad@techpines.com","email":"brad@techpines.com"}]},"2.2.1":{"name":"asset-rack","version":"2.2.1","description":"Static Web Framework for Nodejs","author":{"name":"Brad Carleton","email":"brad@techpines.com"},"repository":{"type":"git","url":"https://github.com/techpines/asset-rack"},"dependencies":{"browserify":"1.17.3","snockets":"~1.3.8","uglify-js":"~2.2.4","async":"0.1.22","pkgcloud":"0.6.6","less":"~1.3.3","jade":"~0.28.2","mime":"1.2.7","nib":"~0.9.1","stylus":"~0.32.0","underscore":"1.4.4","coffee-script":"~1.6.2","markdown":"0.4.0","node-sassy":"0.0.1"},"devDependencies":{"express.io":"1.1.8","request":"2.12.0","mocha":"1.8.1","chai":"1.4.2"},"scripts":{"test":"./node_modules/mocha/bin/mocha test/test.coffee","compile":"./node_modules/coffee-script/bin/coffee -o compiled/ -c lib/","prepublish":"echo $(pwd) > /tmp/.pwd; ./node_modules/coffee-script/bin/coffee -o compiled/ -c lib/;","postpublish":"rm -rf $(cat /tmp/.pwd)/compiled"},"main":"switch.js","engines":{"node":">= 0.5.0"},"readme":"\n<img src=\"https://s3.amazonaws.com/temp.techpines.com/asset-rack-white.png\">\n\n# The Static Web is here\n\nThe Static Web is __blisteringly fast__.  The Static Web is  __ultra efficient__.  The Static Web is __cutting edge__.  And now it has a hero.\n\n```coffeescript\nrack = require 'asset-rack'\n```\n\nThe Static Web is an incredibly modern, high-performance platform for delivering apps and services.  But before you dive-in, you need to start with the basics.  You need to understand the fundamental building block of the static web, the __asset__.\n\n\n## What is an Asset?\n\n> __An asset is a resource on the web that has the following three features:__\n\n1. __Location (URL)__: Where on the web the resource is located.\n2. __Contents (HTTP Response Body)__: The body of the response received by a web client.\n3. __Meta Data (HTTP Headers)__: Gives information about the resource, like content-type, caching info.\n\nThis simple definition is the theoretical bedrock of this entire framework.\n\n## Getting Started\n\nLet's look at a simple example.\n\n```js\nasset = new rack.Asset({\n    url: '/hello.txt',\n    contents: 'hello world'\n})\n```\n\nNeed to serve that asset with a blisteringly fast in memory cache using express?\n\n```\napp.use(asset)\n```\n\n### Hash for speed and efficiency\n\nWhat's cool is that this new asset is available both here:\n\n```\n/hello.txt\n```\n\nAnd here\n\n```\n/hello-5eb63bbbe01eeed093cb22bb8f5acdc3.txt\n```\n\nThat long string of letters and numbers is the md5 hash of the contents.  If you hit the hash url, then we automatically set the HTTP cache to __never expire__.  \n\nNow proxies, browsers, cloud storage, content delivery networks only need to download your asset one single time.  You have versioning, conflict resolution all in one simple mechanism.  You can update your entire entire app instantaneously.  Fast, efficient, static.\n\n### One Rack to rule them All\n\nAssets need to be managed.  Enter the Rack.  A Rack serializes your assets, allows you to deploy to the cloud, and reference urls and tags in your templates.\n\nSay you have a directory structure like this:\n\n```\n/static      # all your images, fonts, etc.\n/style.less  # a less files with your styles\n```\n\nYou can create a Rack to put all your assets in.\n\n```js\nassets = new rack.Rack([\n    new rack.StaticAssets({\n        urlPrefix: '/static'\n        dirname: __dirname + '/static'\n    }),\n    new rack.LessAsset({\n        url: '/style.css'\n        filename: __dirname + '/style.less'\n    }\n])\n```\n\n### Use in your Templates\n\nAfter you hook into express, you can reference your assets in your server side templates.\n\n```js\nassets.tag('/style.css')\n```\n\nWhich gives you the html tag.\n\n```html\n<link href=\"/style-0f2j9fj039fuw0e9f23.css\" rel=\"stylesheet\">\n```\n\nOr you can grab just the url.\n\n```js\nassets.url('/logo.png')\n```\n\nWhich gives the hashed url.\n\n```\n/logo-34t90j0re9g034o4f3o4f3.png\n```\n\n# Batteries Included\n\nWe have some professional grade assets included.\n\n#### For Javascript\n* [Browserify](https://github.com/techpines/asset-rack/tree/master/lib#browserifyasset-jscoffeescript) - Create browserify assets that allow you to use \"node-style\" requires on the client-side.\n* [Snockets](https://github.com/techpines/asset-rack/tree/master/lib#snocketsasset-jscoffeescript) - Create snockets assets, to get the node-flavor of the \"sprockets\" from rails.\n\n#### For Stylesheets\n* [Less](http://github.com/techpines/asset-rack/tree/master/lib#lessasset) - Compile less assets, ability to use dependencies, minification.\n* [Stylus](https://github.com/techpines/asset-rack/tree/master/lib#stylusasset) - Compile stylu assets, ability to use dependencies, minification.\n\n#### Templates\n* [Jade](https://github.com/techpines/asset-rack/tree/master/lib#jadeasset) - High, performance jade templates precompiled for the browser.\n* [AngularTemplates](https://github.com/techpines/asset-rack/tree/master/lib#angulartemplatesasset) - AngularJS templates for you AngularJS folks.\n\n#### Other\n* [StaticAssets](https://github.com/techpines/asset-rack/tree/master/lib#staticassets) - Images(png, jpg, gif), fonts, whatever you got.\n* [DynamicAssets](https://github.com/techpines/asset-rack/tree/master/lib#dynamicassets) - For compiling file-based assets like Less or Stylus in an entire directory.\n\n## Roll your own\n\nAsset Rack is extremely flexible.  Extend the __Asset__ class and override the __create__ method to roll your own awesomeness, and watch them get automatically ka-pow'ed by your rack.\n\n```js\nSuperCoolAsset = rack.Asset.extend({\n    create: function(options) {\n        this.contents = 'easy, easy'\n        this.emit 'created'\n    }\n})\n```\nOr, for those with more refined taste:\n\n```coffee\nclass SuperCoolAsset extends rack.Asset\n    create: (options) ->\n        @contents = 'even easier with coffee'\n        @emit 'created'\n```\n\nCheckout the [tutorial.](https://github.com/techpines/asset-rack/tree/master/lib#extending-the-asset-class)\n\n\n## Deploying to the Cloud\nYour assets need to be deployed! Here are the current providers that are supported.\n\n### Amazon S3\n\n```js\nassets.deploy({\n    provider: 'amazon',\n    container: 'some-bucket',\n    accessKey: 'aws-access-key',\n    secretKey: 'aws-secret-key',\n}, function(error) {})\n```\n\n### Rackspace Cloud Files\n```js\nassets.deploy(\n    provider: 'rackspace',\n    container: 'some-container',\n    username: 'rackspace-username',\n    apiKey: 'rackspace-api-key',\n}, function(error) {})\n```\n\n### Azure Storage\n```js\nassets.deploy(\n    provider: 'azure',\n    container: 'some-container',\n    storageAccount: 'test-storage-account',\n    storageAccessKey: 'test-storage-access-key'\n}, function(error) {})\n```\n\n### Running in Production Mode\n\nIf you provide the options `configFile` in your deploy options then a config file will be written:\n\n```js\nassets.deploy(\n    configFile: __dirname + '/rack.json'\n    provider: 'amazon'\n    container: ...\n)\n```\n\nThen you can create your assets from the file like this:\n\n```js\nassets = rack.fromConfigFile({\n    configFile: __dirname + '/rack.json'\n    hostname: 'cdn.example.com'\n});\napp.use(assets);\n```\n\nAnd now all of your server side templates will reference your CDN.  Also, if you do happen to hit one of your static urls on the server, then you will be redirected to the CDN.\n\n## FAQ\n\n#### __Why is this better than Connect-Assets?__\n\nThat's easy!\n\n* It works with node.js multi-process and cluster.\n* More built-in assets.\n* Un-opionated, connect-assets dictates your url structure AND directory structure.\n* Ability to deploy to the cloud.\n* Easy to extend.\n* Simpler to use.\n\nWith all that said, much thanks to Trevor for writing connect-assets. \n\n#### __Why is this better than Grunt?__\n\nGrunt is a great build tool.  Asset Rack is not a build a tool.  It never writes files to disk, there is no \"build step\".  Everything happens \"just in time\".\n\nIf you have \"genuine\" build issues, then by all means use Grunt.  You can even use Grunt with Asset Rack.\n\nHowever, if you are only using Grunt to manage your static assets, then you should consider upgrading to Asset Rack.\n\n#### __Why is this better than Wintersmith(Blacksmith)?__\n\nAsset Rack is a static web framework, and at it's core there are only two abstractions, the `Asset` and `Rack` classes.  Wintersmith is a high level framework that solves a more specific problem.\n\nWintersmith could consume Asset Rack as a dependency, and if something more high-level fits your specific use case, then by all means that is probably a good fit.  If you need more flexibilty and power, then go with Asset Rack.\n\n# Changelog\n\n### 2.2.1\n\n* A few small tweaks.\n\n### 2.2.0\n\n* Watch and asset recreation is now working.  This should be considered experimental for this version.\n\n```js\nnew StylusAsset({\n    watch: true,\n    ...\n});\n```\n\n* Gzip is here finally.\n\n```js\nnew BrowserifyAsset({\n    gzip: true,\n    ...\n});\n```\n\n* Now adding sub assets to an asset is much simpler, just use `addAsset`.\n\n```js\nthis.addAsset(asset);\nthis.emit('created');\n```\n\nThanks @moellenbeck, @d1plo1d, @undashes, and @noc7c9 for contributing!\n\n### 2.1.4\n\n* @vicapow Better error handling for `LessAsset`.\n\n### 2.1.3\n\n* @noc7c9 Added generalized `rack.util.walk` function, need to document the function.\n* @noc7c9 Added `DynamicAssets` class.\n* @noc7c9 is awesome.\n\n### 2.1.2\n\n* Added ability to configure Stylus, thanks to @noc7c9.\n\n```coffee\nnew StylusAsset\n  url: '/style.css'\n  filename: __dirname + '/style/fun.styl'\n  config: ->\n    @use bootstrap()\n    @define 'setting', 90\n```\n\nAnd for javascript:\n\n```js\nnew StylusAsset({\n  url: '/style.css',\n  filename: __dirname + '/style/fun.styl',\n  config: function (stylus) {\n    stylus // using \"this\" here seems a little unnatural\n      .use(bootstrap())\n      .define('setting', 90);\n  }\n});\n```\n\n# Test\n\nTesting is easy and fun!\n\n```js\ncd asset-rack\nnpm install\nnpm test\n```\n\n# License\n\n©2012 Brad Carleton, Tech Pines and available under the [MIT license](http://www.opensource.org/licenses/mit-license.php):\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","readmeFilename":"README.md","_id":"asset-rack@2.2.1","dist":{"shasum":"8d9281ff8c3d21d1a535e8f0d22172c6a9c32607","tarball":"https://registry.npmjs.org/asset-rack/-/asset-rack-2.2.1.tgz","integrity":"sha512-syKEQvTrvXot8BIsyPFkaQASA5BuuGHsc6weJzb7uqIllKoYp/9fKOYWlKw4feHG4FIZIZW82X+xXyFMpf4oJA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC/93AziAHe9Rac6GcHy/C4R6dL2lYrxBB+Y46M7+oKwQIhAP+Yd/sa2cbFTO6spGasO4rSiL8Ea1S/TGid3jGVzhyG"}]},"_npmVersion":"1.1.65","_npmUser":{"name":"brad@techpines.com","email":"brad@techpines.com"},"maintainers":[{"name":"brad@techpines.com","email":"brad@techpines.com"}]},"2.2.2":{"name":"asset-rack","version":"2.2.2","description":"Static Web Framework for Nodejs","author":{"name":"Brad Carleton","email":"brad@techpines.com"},"repository":{"type":"git","url":"https://github.com/techpines/asset-rack"},"dependencies":{"browserify":"1.17.3","snockets":"~1.3.8","uglify-js":"~2.4.0","async":"~0.2.9","pkgcloud":"~0.8.12","less":"~1.4.2","jade":"~0.35.0","mime":"1.2.11","nib":"~1.0.1","stylus":"~0.38.0","underscore":"~1.5.2","coffee-script":"~1.6.3","markdown":"~0.5.0","node-sassy":"~0.0.1"},"devDependencies":{"express.io":"1.1.8","request":"2.12.0","mocha":"1.8.1","chai":"1.4.2"},"scripts":{"test":"./node_modules/mocha/bin/mocha test/test.coffee","compile":"./node_modules/coffee-script/bin/coffee -o compiled/ -c lib/","prepublish":"echo $(pwd) > /tmp/.pwd; ./node_modules/coffee-script/bin/coffee -o compiled/ -c lib/;","postpublish":"rm -rf $(cat /tmp/.pwd)/compiled"},"main":"switch.js","engines":{"node":">= 0.5.0"},"readme":"<img src=\"https://s3.amazonaws.com/temp.techpines.com/asset-rack-white.png\">\n\n# The Static Web is here\n\nThe Static Web is __blisteringly fast__.  The Static Web is  __ultra efficient__.  The Static Web is __cutting edge__.  And now it has a hero.\n\n```coffeescript\nrack = require 'asset-rack'\n```\n\nThe Static Web is an incredibly modern, high-performance platform for delivering apps and services.  But before you dive-in, you need to start with the basics.  You need to understand the fundamental building block of the static web, the __asset__.\n\n\n## What is an Asset?\n\n> __An asset is a resource on the web that has the following three features:__\n\n1. __Location (URL)__: Where on the web the resource is located.\n2. __Contents (HTTP Response Body)__: The body of the response received by a web client.\n3. __Meta Data (HTTP Headers)__: Gives information about the resource, like content-type, caching info.\n\nThis simple definition is the theoretical bedrock of this entire framework.\n\n## Getting Started\n\nLet's look at a simple example.\n\n```js\nasset = new rack.Asset({\n    url: '/hello.txt',\n    contents: 'hello world'\n})\n```\n\nNeed to serve that asset with a blisteringly fast in memory cache using express?\n\n```\napp.use(asset)\n```\n\n### Hash for speed and efficiency\n\nWhat's cool is that this new asset is available both here:\n\n```\n/hello.txt\n```\n\nAnd here\n\n```\n/hello-5eb63bbbe01eeed093cb22bb8f5acdc3.txt\n```\n\nThat long string of letters and numbers is the md5 hash of the contents.  If you hit the hash url, then we automatically set the HTTP cache to __never expire__.  \n\nNow proxies, browsers, cloud storage, content delivery networks only need to download your asset one single time.  You have versioning, conflict resolution all in one simple mechanism.  You can update your entire entire app instantaneously.  Fast, efficient, static.\n\n### One Rack to rule them All\n\nAssets need to be managed.  Enter the Rack.  A Rack serializes your assets, allows you to deploy to the cloud, and reference urls and tags in your templates.\n\nSay you have a directory structure like this:\n\n```\n/static      # all your images, fonts, etc.\n/style.less  # a less files with your styles\n```\n\nYou can create a Rack to put all your assets in.\n\n```js\nassets = new rack.Rack([\n    new rack.StaticAssets({\n        urlPrefix: '/static',\n        dirname: __dirname + '/static'\n    }),\n    new rack.LessAsset({\n        url: '/style.css',\n        filename: __dirname + '/style.less'\n    })\n])\n```\n\n### Use in your Templates\n\nAfter you hook into express, you can reference your assets in your server side templates.\n\n```js\nassets.tag('/style.css')\n```\n\nWhich gives you the html tag.\n\n```html\n<link href=\"/style-0f2j9fj039fuw0e9f23.css\" rel=\"stylesheet\">\n```\n\nOr you can grab just the url.\n\n```js\nassets.url('/logo.png')\n```\n\nWhich gives the hashed url.\n\n```\n/logo-34t90j0re9g034o4f3o4f3.png\n```\n\n# Batteries Included\n\nWe have some professional grade assets included.\n\n#### For Javascript\n* [Browserify](https://github.com/techpines/asset-rack/tree/master/lib#browserifyasset-jscoffeescript) - Create browserify assets that allow you to use \"node-style\" requires on the client-side.\n* [Snockets](https://github.com/techpines/asset-rack/tree/master/lib#snocketsasset-jscoffeescript) - Create snockets assets, to get the node-flavor of the \"sprockets\" from rails.\n\n#### For Stylesheets\n* [Less](http://github.com/techpines/asset-rack/tree/master/lib#lessasset) - Compile less assets, ability to use dependencies, minification.\n* [Stylus](https://github.com/techpines/asset-rack/tree/master/lib#stylusasset) - Compile stylu assets, ability to use dependencies, minification.\n\n#### Templates\n* [Jade](https://github.com/techpines/asset-rack/tree/master/lib#jadeasset) - High, performance jade templates precompiled for the browser.\n* [AngularTemplates](https://github.com/techpines/asset-rack/tree/master/lib#angulartemplatesasset) - AngularJS templates for you AngularJS folks.\n\n#### Other\n* [StaticAssets](https://github.com/techpines/asset-rack/tree/master/lib#staticassets) - Images(png, jpg, gif), fonts, whatever you got.\n* [DynamicAssets](https://github.com/techpines/asset-rack/tree/master/lib#dynamicassets) - For compiling file-based assets like Less or Stylus in an entire directory.\n\n## Roll your own\n\nAsset Rack is extremely flexible.  Extend the __Asset__ class and override the __create__ method to roll your own awesomeness, and watch them get automatically ka-pow'ed by your rack.\n\n```js\nSuperCoolAsset = rack.Asset.extend({\n    create: function(options) {\n        this.contents = 'easy, easy',\n        this.emit 'created',\n    }\n})\n```\nOr, for those with more refined taste:\n\n```coffee\nclass SuperCoolAsset extends rack.Asset\n    create: (options) ->\n        @contents = 'even easier with coffee'\n        @emit 'created'\n```\n\nCheckout the [tutorial.](https://github.com/techpines/asset-rack/tree/master/lib#extending-the-asset-class)\n\n\n## Deploying to the Cloud\nYour assets need to be deployed! Here are the current providers that are supported.\n\n### Amazon S3\n\n```js\nassets.deploy({\n    provider: 'amazon',\n    container: 'some-bucket',\n    accessKey: 'aws-access-key',\n    secretKey: 'aws-secret-key',\n}, function(error) {})\n```\n\n### Rackspace Cloud Files\n```js\nassets.deploy(\n    provider: 'rackspace',\n    container: 'some-container',\n    username: 'rackspace-username',\n    apiKey: 'rackspace-api-key',\n}, function(error) {})\n```\n\n### Azure Storage\n```js\nassets.deploy(\n    provider: 'azure',\n    container: 'some-container',\n    storageAccount: 'test-storage-account',\n    storageAccessKey: 'test-storage-access-key'\n}, function(error) {})\n```\n\n### Running in Production Mode\n\nIf you provide the options `configFile` in your deploy options then a config file will be written:\n\n```js\nassets.deploy(\n    configFile: __dirname + '/rack.json',\n    provider: 'amazon',\n    container: ...\n)\n```\n\nThen you can create your assets from the file like this:\n\n```js\nassets = rack.fromConfigFile({\n    configFile: __dirname + '/rack.json',\n    hostname: 'cdn.example.com'\n});\napp.use(assets);\n```\n\nAnd now all of your server side templates will reference your CDN.  Also, if you do happen to hit one of your static urls on the server, then you will be redirected to the CDN.\n\n## FAQ\n\n#### __Why is this better than Connect-Assets?__\n\nThat's easy!\n\n* It works with node.js multi-process and cluster.\n* More built-in assets.\n* Un-opionated, connect-assets dictates your url structure AND directory structure.\n* Ability to deploy to the cloud.\n* Easy to extend.\n* Simpler to use.\n\nWith all that said, much thanks to Trevor for writing connect-assets. \n\n#### __Why is this better than Grunt?__\n\nGrunt is a great build tool.  Asset Rack is not a build a tool.  It never writes files to disk, there is no \"build step\".  Everything happens \"just in time\".\n\nIf you have \"genuine\" build issues, then by all means use Grunt.  You can even use Grunt with Asset Rack.\n\nHowever, if you are only using Grunt to manage your static assets, then you should consider upgrading to Asset Rack.\n\n#### __Why is this better than Wintersmith(Blacksmith)?__\n\nAsset Rack is a static web framework, and at it's core there are only two abstractions, the `Asset` and `Rack` classes.  Wintersmith is a high level framework that solves a more specific problem.\n\nWintersmith could consume Asset Rack as a dependency, and if something more high-level fits your specific use case, then by all means that is probably a good fit.  If you need more flexibilty and power, then go with Asset Rack.\n\n# Changelog\n\n### 2.2.1\n\n* A few small tweaks.\n\n### 2.2.0\n\n* Watch and asset recreation is now working.  This should be considered experimental for this version.\n\n```js\nnew StylusAsset({\n    watch: true,\n    ...\n});\n```\n\n* Gzip is here finally.\n\n```js\nnew BrowserifyAsset({\n    gzip: true,\n    ...\n});\n```\n\n* Now adding sub assets to an asset is much simpler, just use `addAsset`.\n\n```js\nthis.addAsset(asset);\nthis.emit('created');\n```\n\nThanks @moellenbeck, @d1plo1d, @undashes, and @noc7c9 for contributing!\n\n### 2.1.4\n\n* @vicapow Better error handling for `LessAsset`.\n\n### 2.1.3\n\n* @noc7c9 Added generalized `rack.util.walk` function, need to document the function.\n* @noc7c9 Added `DynamicAssets` class.\n* @noc7c9 is awesome.\n\n### 2.1.2\n\n* Added ability to configure Stylus, thanks to @noc7c9.\n\n```coffee\nnew StylusAsset\n  url: '/style.css'\n  filename: __dirname + '/style/fun.styl'\n  config: ->\n    @use bootstrap()\n    @define 'setting', 90\n```\n\nAnd for javascript:\n\n```js\nnew StylusAsset({\n  url: '/style.css',\n  filename: __dirname + '/style/fun.styl',\n  config: function (stylus) {\n    stylus // using \"this\" here seems a little unnatural\n      .use(bootstrap())\n      .define('setting', 90);\n  }\n});\n```\n\n# Test\n\nTesting is easy and fun!\n\n```js\ncd asset-rack\nnpm install\nnpm test\n```\n\n# License\n\n©2012 Brad Carleton, Tech Pines and available under the [MIT license](http://www.opensource.org/licenses/mit-license.php):\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/techpines/asset-rack/issues"},"_id":"asset-rack@2.2.2","dist":{"shasum":"fc2836e98ce680725e2c7593404a9c15eb0b99a6","tarball":"https://registry.npmjs.org/asset-rack/-/asset-rack-2.2.2.tgz","integrity":"sha512-nEWC2atfUNKQmmqRZ6/ZrpBqVWWv29jV97bUa8U2gdGWgtEmWUn9sNaskGugNhBIT3/EzlcMfSMEi/hnZQiVBA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIF9NbTG3Nuv+uwQ1uQEDB0Nq6ytOywFaFBEfgT9acpnvAiEAiVaElt/Wm4Fcbfd8F66ATEft8L+0YkJ6ToJLqj1fHic="}]},"_from":".","_npmVersion":"1.3.5","_npmUser":{"name":"brad@techpines.com","email":"brad@techpines.com"},"maintainers":[{"name":"brad@techpines.com","email":"brad@techpines.com"}]}},"readme":"\n![asset-rack!](http://www.techpines.com/static/logo/asset-rack.png)\n\nThe best asset management framework for node. (period)\n\n## Features\n\n1. Dynamic asset creation for js, css, html templates, images, fonts.\n2. Support for js/coffescript, browserify (node-style requires).\n3. Support for less.\n4. Support for jade templates.\n4. Multi-process, multi-server out of the box.  Share nothing.\n5. Filenames hashed for \"forever\" HTML caching and easy CDN updates.\n6. No need to ever compile static files to disk, all-in memory.\n7. Ability to push compiled files to Amazon S3 for use with Cloudfront.\n8. Can be plugged into express as connect middleware.\n9. Easily extensible.\n\n## Install\n\n```bash\nnpm install asset-rack\n```\n\n# Tutorial\nHere is a simple walk throught that demonstrates some of the\nmajor features of asset rack.\n\n## Create your Assets\nFirst create your assets.  Here we are creating our stylesheets, \njavascript code, and javascript templates from less, coffeescript and jade.\n```coffeescript\nrack = require('asset-rack')\n\nassets = new rack.AssetPackage\n    assets: [\n        new rack.LessAsset\n            url: '/style.css'\n            filename: \"#{__dirname}/path/to/file.less\"\n    ,\n        new rack.BrowserifyAsset\n            url: '/app.js'\n            filename: \"#{__dirname}/path/to/app.coffee\"\n    ,\n        new rack.JadeAsset\n            url: '/templates.js'\n            dirname: \"#{__dirname}/templates\"\n    ]\n\nassets.on 'complete', ->\n    console.log 'hey all my assets were created!'\n```\n\n## Hook into Express\nOnce your assets have been created you can hook them \ninto express with ease.\n```coffeescript\nassets.on 'complete', ->\n    app = express.createServer()\n    app.configure ->\n        app.use assets.middlware()\n```\n\n## Markup Functions\n\nIn your jade templates you can include the tags by referencing their url.\n\n```\n!= assets.tag('/style.css')\n!= assets.tag('/app.js')\n!= assets.tag('/templates.js')\n```\nWhich results in the following html:\n\n```html\n<link href=\"/style-{md5-sum}.css\" rel=\"stylesheet\"></link>\n<script src=\"/templates-{md5-sum}.js\"></script>\n<script src=\"/app-{md5-sum}.js\"></script>\n```\n\nNotice the md5 sum that is now on the url.  This means you can HTML cache it forever.  Which is exactly what we do if you have the hash option set.  Also, updating your CDN is a breeze.\n\n## Push Compiled Assets to S3\nNow that all your assets are done and hooked into express you can just\nserve them from your app, but we can do better!  Let's push them to Amazon\nAWS so they can be served by S3 or Cloudfront.\n\n```coffeescript\nassets.on 'complete', ->\n    assets.pushS3\n        key: '<your aws key>'\n        secret: '<your aws secret>'\n        bucket: '<your aws bucket>'\n    assets.on 's3-upload-complete', ->\n        console.log 'our static files are on amazon s3'\n```\n\nEasy.\n\n## Write a JSON config file.\n\n```coffeescript\nfs.writeFileSync '/asset/config.json', JSON.parse(assets.config)\n```\n\n## Upload the Config for Express\n\n```coffescript\napp = express.createServer()\napp.configure ->\n    assetConfig = require('/asset/config.json')\n    assets = new ac.AssetPackage\n        config: require('/asset/config.json')\n        hostname: 'static.cloudfront.net' # Or whatever you CDN host might be.\n```\n\n## New HTML Output\n\n```html\n<link href=\"//static.cloudfront.net/style-{md5-sum}\" rel=\"stylesheet\"></link>\n<script src=\"//static.cloudfront.net/templates-{md5-sum}\"></script>\n<script src=\"//static.cloudfront.net/app-{md5-sum}.js\"></script>\n```     \n\n\n## API Reference\n\n### AssetPackage\n\nThis is the main asset class.\n\n#### Options\n\nEither a list of assets or a config object is required.\n\n* `assets`: An array of assets to use.\n* `config`: Use a config file that tells the server where the assets are\nrather then compile the assets.\n* `hostname` (optional): The hostname for your asset urls.\n\n#### Methods\n* `create`: Asynchronously creates all the packages assets.\n* `middelware`: Returns connect middleware for the assets package.\n* `tag(url)`: Given a url, returns the tag that should be used in HTML.\n* `pushS3`: Pushes all asset contents to their respective \nurls in an Amazon S3 bucket.\n\n#### Events\n\n* `complete`: Emitted by `create` after all assets have been created.\n* `s3-upload-complete`: Emitted after assets have been loaded to s3.\n* `error`: Emitted for any errors.\n\n### BrowserifyAsset\n\nBrowserify is an awesome node project that converts node-style requires\nto requirejs for the frontend.  For more details, check it out,\n[here](https://github.com/substack/node-browserify).\n\n```coffeescript\nnew BrowserifyAsset\n    url: '/app.js'\n    filename: \"#{__dirname}/client/app.js\"\n    compress: true\n```\n\n#### Options\n\n* `url`: The url that should retrieve this resource.\n* `filename`: A filename or list of filenames to be executed by the browser.\n* `require`: A filename or list of filenames to require, should not be necessary\nas the `filename` argument should pull in any requires you need.\n* `compress` (defaults to false): whether to run the javascript through a minifier.\n* `hash` (defaults to true): Set to false if you don't want the md5 sum added to your urls.\n\n### JadeAsset\nThis is an awesome asset.  Ever wanted the simplicity of jade templates\non the browser with lightning fast performance.  Here you go.\n\n```coffeescript\nnew JadeAsset\n    url: '/templates.js'\n    dirname: \"#{__dirname}/templates\"\n```\n\nSo if your template directory looked like this:\n\n```\nindex.jade\ncontact.jade\nuser/\n    profile.jade\n    info.jade\n```\n\nThen in the browser, you would first need to include the [jade runtime](https://github.com/visionmedia/jade/blob/master/runtime.js) script\nthen you could reference your templates like so:\n\n```coffeescript\n$('body').append Templates.index() \n$('body').append Templates.contact()\n$('body').append Templates['user/profile'](username: 'brad', status: 'fun')\n$('body').append Templates['user/info'](\n```\n\nYou can also change the directory `seperator` option for better template names:\n\n```coffeescript\n$('body').append Templates.user_profile(username: 'brad', status: 'fun')\n$('body').append Templates.user_info()\n```\n\n#### Options\n\n* `url`: The url that should retrieve this resource.\n* `dirname`: Directory where template files are located, will grab them recursively.\n* `separator` (defaults to '/'): I like to change it like the example above.\n* `compress` (defaults to false): Whether to minify the javascript or not.\n* `clientVariable` (defaults to 'Templates'): Client side template\nvariable.\n* `hash` (defaults to true): Set to false if you don't want the md5 sum added to your urls.\n\n\n\n### LessAsset\n\nThe less asset basically compiles up and serves your less files as css.  You\ncan read more about less [here](https://github.com/cloudhead/less.js).\n\n```coffeescript\nlessAsset = new ac.LessAsset\n    url: '/style.css'\n    filename: \"#{__dirname}/style/app.less\"\n```\n\n#### Options\n\n* `url`: The url that should retrieve this resource.\n* `hash` (defaults to true): Set to false if you don't want the md5 sum added to your urls.\n* `filename`: Filename of the less file you want to serve.\n* `compress` (defaults to false): Whether to minify the css.\n* `paths`: List of paths to search for `@import` directives.\n\n\n## License\n\n©2012 Brad Carleton, Tech Pines and available under the [MIT license](http://www.opensource.org/licenses/mit-license.php):\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","maintainers":[{"name":"brad@techpines.com","email":"brad@techpines.com"}],"time":{"modified":"2022-06-13T03:34:10.979Z","created":"2012-07-11T19:14:01.075Z","1.0.1":"2012-07-11T19:14:01.926Z","1.1.0":"2012-07-12T17:55:36.188Z","1.1.1":"2012-07-15T15:48:24.460Z","1.1.2":"2012-07-28T17:59:15.290Z","1.1.3":"2012-07-30T19:04:48.828Z","1.1.4":"2012-08-08T14:09:38.374Z","1.1.5":"2012-12-04T04:58:48.641Z","1.1.6":"2012-12-18T13:54:24.206Z","1.1.7":"2012-12-22T23:16:50.859Z","2.0.1":"2013-02-07T19:50:37.623Z","2.0.2":"2013-02-10T19:54:12.993Z","2.0.3":"2013-02-11T16:44:18.802Z","2.0.4":"2013-02-11T16:59:32.139Z","2.0.5":"2013-02-11T17:30:58.736Z","2.0.6":"2013-02-11T17:46:23.565Z","2.0.7":"2013-02-14T20:57:04.722Z","0.0.1":"2013-02-17T19:01:09.620Z","2.0.8":"2013-02-18T14:31:21.064Z","2.0.9":"2013-02-20T01:29:33.119Z","2.0.10":"2013-02-26T19:02:10.939Z","2.0.11":"2013-02-27T20:10:24.118Z","2.1.0":"2013-03-04T15:34:14.959Z","2.1.1":"2013-03-05T00:42:51.660Z","2.1.2":"2013-03-06T15:40:35.552Z","2.1.3":"2013-03-17T17:08:25.981Z","2.1.4":"2013-03-21T00:45:08.093Z","2.1.5":"2013-03-27T20:06:31.278Z","2.2.0":"2013-05-12T01:44:25.116Z","2.2.1":"2013-06-03T14:50:34.181Z","2.2.2":"2013-10-14T00:28:44.236Z"},"author":{"name":"Brad Carleton","email":"brad@techpines.com"},"repository":{"type":"git","url":"https://github.com/techpines/asset-rack"},"users":{"fgribreau":true,"balderdashy":true}}