{
  "name": "send",
  "description": "Better streaming static file server with Range and conditional-GET support",
  "version": "0.8.3",
  "author": {
    "name": "TJ Holowaychuk",
    "email": "tj@vision-media.ca"
  },
  "contributors": [
    {
      "name": "Douglas Christopher Wilson",
      "email": "doug@somethingdoug.com"
    }
  ],
  "license": "MIT",
  "repository": {
    "type": "git",
    "url": "git://github.com/visionmedia/send"
  },
  "keywords": [
    "static",
    "file",
    "server"
  ],
  "dependencies": {
    "debug": "1.0.4",
    "depd": "0.4.4",
    "destroy": "1.0.3",
    "escape-html": "1.0.1",
    "fresh": "0.2.2",
    "mime": "1.2.11",
    "ms": "0.6.2",
    "on-finished": "2.1.0",
    "range-parser": "~1.0.0"
  },
  "devDependencies": {
    "istanbul": "0.3.0",
    "mocha": "~1.21.0",
    "should": "~4.0.0",
    "supertest": "~0.13.0"
  },
  "engines": {
    "node": ">= 0.8.0"
  },
  "scripts": {
    "test": "mocha --check-leaks --reporter spec --bail",
    "test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --check-leaks --reporter dot",
    "test-travis": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --check-leaks --reporter spec"
  },
  "readme": "# send\n\n[![NPM version](https://badge.fury.io/js/send.svg)](https://badge.fury.io/js/send)\n[![Build Status](https://travis-ci.org/visionmedia/send.svg?branch=master)](https://travis-ci.org/visionmedia/send)\n[![Coverage Status](https://img.shields.io/coveralls/visionmedia/send.svg?branch=master)](https://coveralls.io/r/visionmedia/send)\n[![Gittip](http://img.shields.io/gittip/dougwilson.svg)](https://www.gittip.com/dougwilson/)\n\n  Send is Connect's `static()` extracted for generalized use, a streaming static file\n  server supporting partial responses (Ranges), conditional-GET negotiation, high test coverage, and granular events which may be leveraged to take appropriate actions in your application or framework.\n\n## Installation\n\n    $ npm install send\n\n## Examples\n\n  Small:\n\n```js\nvar http = require('http');\nvar send = require('send');\n\nvar app = http.createServer(function(req, res){\n  send(req, req.url).pipe(res);\n}).listen(3000);\n```\n\n  Serving from a root directory with custom error-handling:\n\n```js\nvar http = require('http');\nvar send = require('send');\nvar url = require('url');\n\nvar app = http.createServer(function(req, res){\n  // your custom error-handling logic:\n  function error(err) {\n    res.statusCode = err.status || 500;\n    res.end(err.message);\n  }\n\n  // your custom headers\n  function headers(res, path, stat) {\n    // serve all files for download\n    res.setHeader('Content-Disposition', 'attachment');\n  }\n\n  // your custom directory handling logic:\n  function redirect() {\n    res.statusCode = 301;\n    res.setHeader('Location', req.url + '/');\n    res.end('Redirecting to ' + req.url + '/');\n  }\n\n  // transfer arbitrary files from within\n  // /www/example.com/public/*\n  send(req, url.parse(req.url).pathname, {root: '/www/example.com/public'})\n  .on('error', error)\n  .on('directory', redirect)\n  .on('headers', headers)\n  .pipe(res);\n}).listen(3000);\n```\n\n## API\n\n### Options\n\n#### etag\n\n  Enable or disable etag generation, defaults to true.\n\n#### dotfiles\n\n  Set how \"dotfiles\" are treated when encountered. A dotfile is a file\n  or directory that begins with a dot (\".\"). Note this check is done on\n  the path itself without checking if the path actually exists on the\n  disk. If `root` is specified, only the dotfiles above the root are\n  checked (i.e. the root itself can be within a dotfile when when set\n  to \"deny\").\n\n  The default value is `'ignore'`.\n\n  - `'allow'` No special treatment for dotfiles.\n  - `'deny'` Send a 403 for any request for a dotfile.\n  - `'ignore'` Pretend like the dotfile does not exist and 404.\n\n#### extensions\n\n  If a given file doesn't exist, try appending one of the given extensions,\n  in the given order. By default, this is disabled (set to `false`). An\n  example value that will serve extension-less HTML files: `['html', 'htm']`.\n  This is skipped if the requested file already has an extension.\n\n#### index\n\n  By default send supports \"index.html\" files, to disable this\n  set `false` or to supply a new index pass a string or an array\n  in preferred order.\n\n#### maxAge\n\n  Provide a max-age in milliseconds for http caching, defaults to 0.\n  This can also be a string accepted by the\n  [ms](https://www.npmjs.org/package/ms#readme) module.\n\n#### root\n\n  Serve files relative to `path`.\n\n### Events\n\n  - `error` an error occurred `(err)`\n  - `directory` a directory was requested\n  - `file` a file was requested `(path, stat)`\n  - `headers` the headers are about to be set on a file `(res, path, stat)`\n  - `stream` file streaming has started `(stream)`\n  - `end` streaming has completed\n\n## Error-handling\n\n  By default when no `error` listeners are present an automatic response will be made, otherwise you have full control over the response, aka you may show a 5xx page etc.\n\n## Caching\n\n  It does _not_ perform internal caching, you should use a reverse proxy cache such\n  as Varnish for this, or those fancy things called CDNs. If your application is small enough that it would benefit from single-node memory caching, it's small enough that it does not need caching at all ;).\n\n## Debugging\n\n To enable `debug()` instrumentation output export __DEBUG__:\n\n```\n$ DEBUG=send node app\n```\n\n## Running tests\n\n```\n$ npm install\n$ npm test\n```\n\n## License \n\n(The MIT License)\n\nCopyright (c) 2012 TJ Holowaychuk &lt;tj@vision-media.ca&gt;\n\nPermission is hereby granted, free of charge, to any person obtaining\na copy of this software and associated documentation files (the\n'Software'), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to\npermit persons to whom the Software is furnished to do so, subject to\nthe following conditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\nIN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\nCLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\nTORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\nSOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n",
  "readmeFilename": "Readme.md",
  "bugs": {
    "url": "https://github.com/visionmedia/send/issues"
  },
  "_id": "send@0.8.3",
  "_from": "send@0.8.3"
}
