{"_id":"connect-file-cache","_rev":"23-4f13d7b09102accf32ed150daf838fe1","name":"connect-file-cache","dist-tags":{"latest":"0.2.5"},"versions":{"0.1.0":{"name":"connect-file-cache","version":"0.1.0","author":{"url":"http://trevorburnham.com","name":"Trevor Burnham"},"_id":"connect-file-cache@0.1.0","maintainers":[{"name":"TrevorBurnham","email":"trevorburnham@gmail.com"}],"homepage":"http://github.com/TrevorBurnham/connect-file-cache","dist":{"shasum":"a063689cb96c35018bf2a4344ca415b98e4d73bb","tarball":"https://registry.npmjs.org/connect-file-cache/-/connect-file-cache-0.1.0.tgz","integrity":"sha512-kbiITqaDZ05c3IzTbuM/rlRDBs8t5klHgl0wvDIR80WXLl0d38yfDtGt7gr/Kj8IGm7vAg3MukVGt4bkASqhLQ==","signatures":[{"sig":"MEUCIAUnAG7nOg67N5zjtkdX6dTI8UtSSKPu05FFwQhpIVMdAiEA9f5MNuQLkMLfi1PraKUS+QpNeBakKpXgzJI6J9/exew=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"main":"lib/cache.js","engines":{"node":"*"},"scripts":{},"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.","repository":{"url":"git://github.com/TrevorBurnham/connect-file-cache.git","type":"git"},"_npmVersion":"1.0.6","description":"A Connect middleware for mapping routes to memory","directories":{},"_nodeVersion":"v0.4.11","dependencies":{"mime":"1.2.2","zlib-sync":"0.0.1","underscore":"1.1.7"},"_defaultsLoaded":true,"devDependencies":{"connect":"1.6.4","request":"2.1.1","nodeunit":"0.5.4","watch-tree":"0.1.1","coffee-script":"1.1.2"},"_engineSupported":true},"0.2.0":{"name":"connect-file-cache","version":"0.2.0","author":{"url":"http://trevorburnham.com","name":"Trevor Burnham"},"_id":"connect-file-cache@0.2.0","maintainers":[{"name":"TrevorBurnham","email":"trevorburnham@gmail.com"}],"homepage":"http://github.com/TrevorBurnham/connect-file-cache","dist":{"shasum":"9ba4a560445d07fe62d874736936177af2afbfd7","tarball":"https://registry.npmjs.org/connect-file-cache/-/connect-file-cache-0.2.0.tgz","integrity":"sha512-NPbAl/ElX2Cb6YP27WeMrgucbOoqv3TH8+9kRWYbJTlX/kcpX8jFp6GDp1oMrdrE8Gn6zONMfFcT2XVDk3sK7Q==","signatures":[{"sig":"MEUCIQCNwdwKLRFIJGnZzeJEt1S+eJi+u0JtQnbXvZjdcdysdQIgWiPlj8y12iQTd7pSzvLgr82CZikU0JNwGtLm5EFPa1U=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"main":"lib/cache.js","engines":{"node":"*"},"scripts":{},"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.","repository":{"url":"git://github.com/TrevorBurnham/connect-file-cache.git","type":"git"},"_npmVersion":"1.0.6","description":"A Connect middleware for mapping routes to memory","directories":{},"_nodeVersion":"v0.4.11","dependencies":{"mime":"1.2.2","zlib-sync":"0.0.1","underscore":"1.1.7"},"_defaultsLoaded":true,"devDependencies":{"connect":"1.6.4","request":"2.1.1","nodeunit":"0.5.4","watch-tree":"0.1.1","coffee-script":"1.1.2"},"_engineSupported":true},"0.2.1":{"name":"connect-file-cache","version":"0.2.1","author":{"url":"http://trevorburnham.com","name":"Trevor Burnham"},"_id":"connect-file-cache@0.2.1","maintainers":[{"name":"TrevorBurnham","email":"trevorburnham@gmail.com"}],"homepage":"http://github.com/TrevorBurnham/connect-file-cache","dist":{"shasum":"0aa73dad113d4b221308a2d0708705d556281f6c","tarball":"https://registry.npmjs.org/connect-file-cache/-/connect-file-cache-0.2.1.tgz","integrity":"sha512-WjR5Mj0qBRlYQ7PYuBYPnVANl1uYCFmGiC0vdgO+t+2KBySd0gVtjDdNkNu3GGuyBqMX8QqjegyulP9iZNAMTA==","signatures":[{"sig":"MEQCIH/8woBtXl0OH+TMRJE2bcqq7e3ntXOYymOHZ2WQC6TnAiByG+CSw4WFa070B9qxebQo4t6lV32P3fx+na+g/A3S1g==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"main":"lib/cache.js","engines":{"node":"*"},"scripts":{},"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.","repository":{"url":"git://github.com/TrevorBurnham/connect-file-cache.git","type":"git"},"_npmVersion":"1.0.6","description":"A Connect middleware for mapping routes to memory","directories":{},"_nodeVersion":"v0.4.11","dependencies":{"mime":"1.2.2","zlib-sync":"0.0.1","underscore":"1.1.7"},"_defaultsLoaded":true,"devDependencies":{"connect":"1.6.4","request":"2.1.1","nodeunit":"0.5.4","watch-tree":"0.1.1","coffee-script":"1.1.2"},"_engineSupported":true},"0.2.2":{"name":"connect-file-cache","version":"0.2.2","author":{"url":"http://trevorburnham.com","name":"Trevor Burnham"},"_id":"connect-file-cache@0.2.2","maintainers":[{"name":"TrevorBurnham","email":"trevorburnham@gmail.com"}],"homepage":"http://github.com/TrevorBurnham/connect-file-cache","dist":{"shasum":"67c0347b8b64740433028b826b73f57916e64cc8","tarball":"https://registry.npmjs.org/connect-file-cache/-/connect-file-cache-0.2.2.tgz","integrity":"sha512-57RAUTl9HmQE/MR3FvQLwEMjZcJDTmjIM3SWhXmMFSwBTLz3vtnzL+dm7Gaeu8fOJbnGoUtURLGnb65UPjDZ9g==","signatures":[{"sig":"MEUCIHG0MrcRiu5YuqNUimuaht5xSbeeJOtKI4axLlNB2rgKAiEA4dxJw+JL+eTJt/HqMI/SfNaLDtEkf4LluQope7WuesE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"main":"lib/cache.js","engines":{"node":"*"},"scripts":{},"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.","repository":{"url":"git://github.com/TrevorBurnham/connect-file-cache.git","type":"git"},"_npmVersion":"1.0.6","description":"A Connect middleware for mapping routes to memory","directories":{},"_nodeVersion":"v0.4.11","dependencies":{"mime":"1.2.2","zlib-sync":"0.0.1","underscore":"1.1.7"},"_defaultsLoaded":true,"devDependencies":{"connect":"1.6.4","request":"2.1.1","nodeunit":"0.5.4","watch-tree":"0.1.1","coffee-script":"1.1.2"},"_engineSupported":true},"0.2.3":{"name":"connect-file-cache","version":"0.2.3","author":{"url":"http://trevorburnham.com","name":"Trevor Burnham"},"_id":"connect-file-cache@0.2.3","maintainers":[{"name":"TrevorBurnham","email":"trevorburnham@gmail.com"}],"homepage":"http://github.com/TrevorBurnham/connect-file-cache","dist":{"shasum":"fe00b8a6248d7d2ee35d132ac19d7c8b07fdc84a","tarball":"https://registry.npmjs.org/connect-file-cache/-/connect-file-cache-0.2.3.tgz","integrity":"sha512-mUDAKfXB06Du9X+Dp9prp+guyq9SYTOfvqx8K1yd8Ft8aJqNA/8zdPz25KxAW/CmnLRVtEJI27TFru1hHgfmAw==","signatures":[{"sig":"MEUCIQDBnencc87QbMI4g3L+LjnKpQBEyd3p/L95coY0Xzc0BQIgdPyWgnhz9+nTBGoYGK9drtbU9SwECbkC2NHBMX8fwOU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"main":"lib/cache.js","engines":{"node":"*"},"scripts":{},"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.","repository":{"url":"git://github.com/TrevorBurnham/connect-file-cache.git","type":"git"},"_npmVersion":"1.0.6","description":"A Connect middleware for mapping routes to memory","directories":{},"_nodeVersion":"v0.4.11","dependencies":{"mime":"1.2.2","zlib-sync":"0.0.1","underscore":"1.1.7"},"_defaultsLoaded":true,"devDependencies":{"connect":"1.6.4","request":"2.1.1","nodeunit":"0.5.4","watch-tree":"0.1.1","coffee-script":"1.1.2"},"_engineSupported":true},"0.2.4":{"name":"connect-file-cache","version":"0.2.4","author":{"url":"http://trevorburnham.com","name":"Trevor Burnham"},"_id":"connect-file-cache@0.2.4","maintainers":[{"name":"TrevorBurnham","email":"trevorburnham@gmail.com"}],"homepage":"http://github.com/TrevorBurnham/connect-file-cache","dist":{"shasum":"6d6afddde29314f2e5cb2c0725d487caadc75913","tarball":"https://registry.npmjs.org/connect-file-cache/-/connect-file-cache-0.2.4.tgz","integrity":"sha512-rv4H3Kosjo9DuQ5gK3Tspg43pSfPjbEFSNdAVA877UZhtK3h7klqcGQA9k0i+SisOiNsLSMLdxYL0we0pvvceA==","signatures":[{"sig":"MEUCIA6bEWRnbojFPPj7ujf2wdKLBqyYsGa0wvai5svnuw57AiEAkujKyJgaNJsPeRNWFRT3SsdCOPzkZL5RMLyfbGRma5Q=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"main":"lib/cache.js","engines":{"node":">=0.6.1"},"_npmUser":{"name":"TrevorBurnham","email":"trevorburnham@gmail.com"},"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.","repository":{"url":"git://github.com/TrevorBurnham/connect-file-cache.git","type":"git"},"_npmVersion":"1.0.104","description":"A Connect middleware for mapping routes to memory","directories":{},"_nodeVersion":"v0.6.1","dependencies":{"mime":"1.2.2","underscore":"1.1.7"},"_defaultsLoaded":true,"devDependencies":{"connect":"1.6.4","request":"2.1.1","nodeunit":"0.5.4","watch-tree":"0.1.1","coffee-script":"1.1.2"},"_engineSupported":true},"0.2.5":{"name":"connect-file-cache","version":"0.2.5","author":{"url":"http://trevorburnham.com","name":"Trevor Burnham"},"_id":"connect-file-cache@0.2.5","maintainers":[{"name":"TrevorBurnham","email":"trevorburnham@gmail.com"},{"name":"trevorburnham","email":"trevorburnham@gmail.com"}],"homepage":"http://github.com/TrevorBurnham/connect-file-cache","dist":{"shasum":"0588275c32d70f1728e5a4179fb41646d9cca43d","tarball":"https://registry.npmjs.org/connect-file-cache/-/connect-file-cache-0.2.5.tgz","integrity":"sha512-NqQnnqcpOmc1x/GmbJjEFjiqn6WW/usEN9AOscspGSNrgamV98eA+YD7gw6O8RGkcZgji87cAHR8UAQc23BGKw==","signatures":[{"sig":"MEYCIQDl9hCtyK2F6Cwd38OuS4HwD3/BUE/inWRmW2R8qQjpUwIhALGf7z25O3oZcvy71ukiI0rwplpijtPOj8c/u4vAdV/b","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"main":"lib/cache.js","_from":".","readme":"# connect-file-cache\n\nA static cache middleware for [Connect](http://senchalabs.github.com/connect/) spun off from [connect-assets](http://github.com/TrevorBurnham/connect-assets). Written in [CoffeeScript](http://coffeescript.org) by the author of [CoffeeScript: Accelerated JavaScript Development](http://pragprog.com/book/tbcoffee/coffeescript).\n\n## Why connect-file-cache?\n\nIf you're just serving files, Connect's own [static](http://senchalabs.github.com/connect/middleware-static.html) (possibly with [staticCache](http://senchalabs.github.com/connect/middleware-staticCache.html) on top) is quite sufficient. But suppose you want to serve, say, compiled and minified CoffeeScript with a far-future expires header, and you want multiple routes to be able to point at that same file (say, one with an MD5 suffix for disambiguation, and one without).\n\nThat's the use case connect-file-cache was born out of. It's designed to be very fast. The \"files\" it serves don't have to exist on disk at all. On the other hand, it's not suitable for serving large files (or many), because *all files are stored in memory.*\n\n**Bonus:** connect-file-cache also does gzip (when requested)!\n\n## How do I use it?\n\nInstall:\n\n    npm install connect-file-cache\n\nThen in your app:\n\n    connectCache = require 'connect-file-cache'\n    cache = connectCache options\n    app.use cache.middleware\n\nwhere `options` is a hash that may include\n\n* `src`: A dir containing files to be served directly (defaults to `null`)\n* `routePrefix`: Data will be served from this path (defaults to `/`)\n\nYou can map routes directly to strings like so:\n\n    cache.set 'foo/bar.txt', 'str'\n\nThen go to `yourapp/foo/bar.txt` in your browser.\n\n## Additional Features\n\nYou can map multiple routes by passing in an array as the first argument:\n\n    cache.set ['foo/bar.txt', 'foo/baz.txt'], 'str'\n\nAnd if you want the browser to download the file rather than trying to display it, set the `attachment` flag to `true`:\n\n    cache.set 'foo/bar.txt', 'str', attachment: true\n\nBy default, MIME types are automatically inferred from file extensions. But you can override this with the `mime` option:\n\n    cache.set 'foo/bar.txt', 'str', mime: 'html'\n\nTo support browser-side caching, connect-file-cache handles \"If-Modified-Since\" requests. But to prevent even those few milliseconds of extra latency, you can set `expires` to `false`—meaning that the browser will never download the file again (from the same route):\n\n    cache.set 'foo/bar.txt', 'str', expires: false\n\nFor more advanced examples, check the `test` folder.\n\n## Credits\n\nThoroughly inspired by Connect's [static](https://github.com/senchalabs/connect/blob/1.6.4/lib/middleware/static.js) middleware.\n\n## License\n\n©2011 Trevor Burnham 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.","engines":{"node":">=0.6.1"},"_npmUser":{"name":"trevorburnham","email":"trevorburnham@gmail.com"},"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.","repository":{"url":"git://github.com/TrevorBurnham/connect-file-cache.git","type":"git"},"_npmVersion":"1.2.10","description":"A Connect middleware for mapping routes to memory","directories":{},"dependencies":{"mime":"1.2.2","underscore":"1.1.7"},"readmeFilename":"README.mdown","devDependencies":{"connect":"1.6.4","request":"2.1.1","nodeunit":"0.5.4","watch-tree":"0.1.1","coffee-script":"1.1.2"}}},"time":{"created":"2011-09-24T21:40:11.813Z","modified":"2026-04-21T13:48:19.499Z","0.1.0":"2011-09-24T21:40:12.011Z","0.2.0":"2011-10-02T20:22:06.927Z","0.2.1":"2011-10-02T20:30:08.701Z","0.2.2":"2011-10-05T21:09:36.922Z","0.2.3":"2011-10-20T22:54:53.342Z","0.2.4":"2011-11-14T13:43:04.970Z","0.2.5":"2013-04-29T15:10:05.266Z"},"author":{"url":"http://trevorburnham.com","name":"Trevor Burnham"},"homepage":"http://github.com/TrevorBurnham/connect-file-cache","repository":{"url":"git://github.com/TrevorBurnham/connect-file-cache.git","type":"git"},"description":"A Connect middleware for mapping routes to memory","maintainers":[{"email":"trevorburnham@gmail.com","name":"trevorburnham"},{"email":"dburwell@groupon.com","name":"dustyburwell"}],"readme":"ERROR: No README data found!"}