{"name":"deliver","version":"0.1.8","keywords":["static","remote","files","serve"],"author":{"name":"Scott Corgan"},"license":"MIT","_id":"deliver@0.1.8","maintainers":[{"name":"scottcorgan","email":"scottcorgan@gmail.com"}],"homepage":"https://github.com/scottcorgan/deliver","bugs":{"url":"https://github.com/scottcorgan/deliver/issues"},"dist":{"shasum":"6af1c823bd1a65124b4a134f8eb26e0a60441468","tarball":"http://registry-npm.ywwl.com/deliver/download/deliver-0.1.8.tgz","integrity":"sha512-6+tUIdw7BwzYuLd0zZAp11TEhsfCU3A5xkeqZFjGQTdhT/WqcUsQ2Qw7xQQ9i590GoauYSOK6+vuX9A+AiK2Hw==","signatures":[{"sig":"MEQCIEb1kHXNuKPAhPDmRZ7aB7R01zBwmNoTCEGLDE5C3ks0AiB2+q016vYRsUU4ya6dNsLBspz1hHeTYE73uRed+iKtoA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"size":1854,"noattachment":false,"key":"/deliver/-/deliver-0.1.8.tgz"},"main":"index.js","_from":".","scripts":{"test":"node test/index.js | node_modules/.bin/tspec"},"_npmUser":{"name":"scottcorgan","email":"scottcorgan@gmail.com"},"repository":{"url":"https://github.com/scottcorgan/deliver.git","type":"git"},"_npmVersion":"1.4.4","description":"Deliver local and remote static files","dependencies":{"send":"~0.1.4","is-url":"~1.0.0","request":"~2.33.0","defaults":"~1.0.0"},"devDependencies":{"tape":"~2.3.2","connect":"~2.12.0","request":"~2.31.0","tap-spec":"~0.1.3"},"directories":{},"readme":"# deliver\n\nServe local and remote static files.\n\n## Install\n\n```\nnpm install deliver --save\n```\n\n## Usage\n\n#### Local file\n\n```js\nvar deliver = require('deliver');\nvar http = require('http');\n\nhttp.createServer(function (req, res) {\n  // Conditionally set the request url\n  req.url = '/some';\n  \n  deliver(req, res, {\n    root: process.cwd() // OPTIONAL\n  }).pipe(res);\n  \n}).listen(3000);\n```\n\n#### Remote file (proxy)\n\n```js\nvar deliver = require('deliver');\nvar http = require('http');\n\nhttp.createServer(function (req, res) {\n  // Conditionally set the request url\n  req.url = '/somefile.html';\n  \n  deliver(req, res, {\n    root: 'http://www.somewhere.com'\n  }).pipe(res);\n  \n}).listen(3000);\n```\n\n## deliver(req, res,[, options])\n\nReturns a stream almost identical to the [`send` module](https://www.npmjs.org/package/send). That means you can listen to the same events (i.e. *directory*, *error*, etc).\n\n* `req` - the request object\n* `res` - the response object\n* `options`\n  * `root` - set the root directory that holds the static files to serve. This can be a path or a url\n  * `index` - set a custom index file. Pass `false` to disable or pass a string or array of strings for a custom index file.\n  * `contentType` - override the content type\n  \n## Run Tests\n\n```\nnpm install\nnpm test\n```","publish_time":1393957389341,"_cnpm_publish_time":1393957389341,"dist-tags":{"0.4.6-rc1":"0.4.6-rc1","0.4.6-rc2":"0.4.6-rc2","latest":"1.1.11"}}