{"name":"deliver","version":"1.1.11","keywords":["static","remote","files","serve"],"author":{"name":"Scott Corgan"},"license":"MIT","_id":"deliver@1.1.11","maintainers":[{"name":"scottcorgan","email":"scottcorgan@gmail.com"}],"homepage":"https://github.com/scottcorgan/deliver","bugs":{"url":"https://github.com/scottcorgan/deliver/issues"},"dist":{"shasum":"2d4b3adb995df4b9401cf1170a9a3922d4e5b84f","tarball":"http://registry-npm.ywwl.com/deliver/download/deliver-1.1.11.tgz","integrity":"sha512-E5rAtCxdPQB5s3fu0jz3hoDk7Xo/bAOzwA0lVR1RBTsqAxcc4KKDrTLSYBZNRnrG/i1GkJbwJ0OLhxoWkfY/ig==","signatures":[{"sig":"MEUCIQDZ7boeZ/9/HTj1O+WURZ7HwNlDr/HrhfGoLNtoK0qgowIgAhFuACMu0fG8Pv1PObY/GMKXF5g1ZRDbJvpgluy5+m8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"size":3621,"noattachment":false,"key":"/deliver/-/deliver-1.1.11.tgz"},"main":"index.js","_from":".","_shasum":"2d4b3adb995df4b9401cf1170a9a3922d4e5b84f","gitHead":"94ee0c508fb51dab9b956f5ba77920e808898895","scripts":{"test":"node test/index.js | tap-spec"},"_npmUser":{"name":"scottcorgan","email":"scottcorgan@gmail.com"},"repository":{"url":"https://github.com/scottcorgan/deliver.git","type":"git"},"_npmVersion":"2.5.1","description":"Deliver local and remote static files","_nodeVersion":"0.12.0","dependencies":{"send":"^0.12.2","is-url":"^1.2.0","accepts":"^1.2.5","defaults":"^1.0.2","join-path":"^1.0.0","hyperquest":"^1.0.1","mime-types":"^2.0.10","on-headers":"^1.0.0","compressible":"^2.0.2","fast-url-parser":"^1.1.3"},"devDependencies":{"pako":"^0.2.5","tape":"^3.5.0","connect":"~2.12.0","request":"^2.53.0","tap-spec":"^2.2.2"},"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":1426789906512,"_cnpm_publish_time":1426789906512,"dist-tags":{"0.4.6-rc1":"0.4.6-rc1","0.4.6-rc2":"0.4.6-rc2","latest":"1.1.11"}}