{
  "name": "send",
  "description": "Better streaming static file server with Range and conditional-GET support",
  "version": "0.9.1",
  "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": "~2.0.0",
    "depd": "0.4.4",
    "destroy": "1.0.3",
    "escape-html": "1.0.1",
    "etag": "~1.3.0",
    "fresh": "0.2.4",
    "mime": "1.2.11",
    "ms": "0.6.2",
    "on-finished": "2.1.0",
    "range-parser": "~1.0.0"
  },
  "devDependencies": {
    "istanbul": "0.3.2",
    "mocha": "~1.21.0",
    "should": "~4.0.0",
    "supertest": "~0.13.0"
  },
  "files": [
    "History.md",
    "LICENSE",
    "index.js"
  ],
  "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][npm-image]][npm-url]\n[![NPM Downloads][downloads-image]][downloads-url]\n[![Build Status][travis-image]][travis-url]\n[![Test Coverage][coveralls-image]][coveralls-url]\n[![Gittip][gittip-image]][gittip-url]\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```bash\n$ npm install send\n```\n\n## API\n\n```js\nvar send = require('send')\n```\n\n### send(req, path, [options])\n\nCreate a new `SendStream` for the given path to send to a `res`. The `req` is\nthe Node.js HTTP request and the `path` is a urlencoded path to send (urlencoded,\nnot the actual file-system path).\n\n#### Options\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##### etag\n\n  Enable or disable etag generation, defaults to true.\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##### lastModified\n\n  Enable or disable `Last-Modified` header, defaults to true. Uses the file\n  system's last modified value.\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\nThe `SendStream` is an event emitter and will emeit the following 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### .pipe\n\nThe `pipe` method is used to pipe the response into the Node.js HTTP response\nobject, typically `send(req, path, options).pipe(res)`.\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## 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## License \n\n[MIT](LICENSE)\n\n[npm-image]: https://img.shields.io/npm/v/send.svg?style=flat\n[npm-url]: https://npmjs.org/package/send\n[travis-image]: https://img.shields.io/travis/visionmedia/send.svg?style=flat\n[travis-url]: https://travis-ci.org/visionmedia/send\n[coveralls-image]: https://img.shields.io/coveralls/visionmedia/send.svg?style=flat\n[coveralls-url]: https://coveralls.io/r/visionmedia/send?branch=master\n[downloads-image]: https://img.shields.io/npm/dm/send.svg?style=flat\n[downloads-url]: https://npmjs.org/package/send\n[gittip-image]: https://img.shields.io/gittip/dougwilson.svg?style=flat\n[gittip-url]: https://www.gittip.com/dougwilson/\n",
  "readmeFilename": "Readme.md",
  "bugs": {
    "url": "https://github.com/visionmedia/send/issues"
  },
  "_id": "send@0.9.1",
  "dist": {
    "shasum": "451b9d270f6592589a7f1c10b4f206992ebe694f"
  },
  "_from": "send@0.9.1",
  "_resolved": "https://registry.npmjs.org/send/-/send-0.9.1.tgz"
}
