{"name":"server-router","version":"5.2.0","description":"Server router","main":"index.js","scripts":{"deps":"dependency-check . && dependency-check . --extra --no-dev","test":"standard && npm run deps && NODE_ENV=test node test","test:cov":"standard && npm run deps && NODE_ENV=test istanbul cover test.js"},"repository":{"type":"git","url":"git+https://github.com/yoshuawuyts/server-router.git"},"keywords":["server","router","trie","wayfarer"],"license":"MIT","dependencies":{"pathname-match":"^1.1.3","urlencode":"^1.1.0","wayfarer":"^6.1.4"},"devDependencies":{"concat-stream":"^1.5.1","dependency-check":"^2.5.1","get-server-port":"^1.0.0","istanbul":"^0.4.1","standard":"^8.0.0","tape":"^4.2.2"},"gitHead":"35319820e7c645e2384eb75d455846e0aab14ea0","bugs":{"url":"https://github.com/yoshuawuyts/server-router/issues"},"homepage":"https://github.com/yoshuawuyts/server-router#readme","_id":"server-router@5.2.0","_shasum":"dfe63093650fe8d8340d92d47287360377e76d10","_from":".","_npmVersion":"4.1.2","_nodeVersion":"6.4.0","_npmUser":{"name":"yoshuawuyts","email":"i@yoshuawuyts.com"},"dist":{"shasum":"dfe63093650fe8d8340d92d47287360377e76d10","tarball":"http://registry-npm.ywwl.com/server-router/download/server-router-5.2.0.tgz","integrity":"sha512-34kJMMXIy7kYr8g9uIdrY00jG+SkbikqwbG6mm76nso+QNKnDrotAOcgLlgE96d8vXWHEQsi6aUuaUcxLX9W3g==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDB/xq02CliBYrjXfMLVqgG/7qLZVrieY25GURSUa4HtQIgW+oBD7mOmgBVk9uh2bz52fLGEOn14J70jRQmnsogYTg="}],"size":3747,"noattachment":false,"key":"/server-router/-/server-router-5.2.0.tgz"},"maintainers":[{"email":"kevin.chapelier@gmail.com","name":"kchapelier"},{"email":"w@tson.dk","name":"watson"},{"email":"i@yoshuawuyts.com","name":"yoshuawuyts"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/server-router-5.2.0.tgz_1497640768284_0.1346785279456526"},"directories":{},"readme":"# server-router [![stability][0]][1]\n[![npm version][2]][3] [![build status][4]][5] [![test coverage][6]][7]\n[![downloads][8]][9] [![js-standard-style][10]][11]\n\nPerformant [radix-trie](https://en.wikipedia.org/wiki/Radix_tree) router for\nstreaming servers.\n\n## Usage\n```js\nvar serverRouter = require('server-router')\nvar http = require('http')\n\nvar router = serverRouter({ default: '/404' })\n\nrouter.route('GET', '/hello', function (req, res, params) {\n  res.end('hello world')\n})\n\nrouter.route('PUT', '/hello/:name', function (req, res, params) {\n  res.end('hi there ' + params.name)\n})\n\nrouter.route('', '/404', function (req, res, params) {\n  res.status = 404\n  res.end('404')\n})\n\nhttp.createServer(router.start()).listen()\n```\n\n## API\n### router = serverRouter(opts)\nCreate a new router with opts.\n\n### router.route(method|[methods], route, function (req, res, params))\nRegister a new route with an HTTP method name and a routename. Can register\nmultiple handlers by passing an array of method names. `params` contains\nmatched partials from the route.\n\n### router.match(req, res)\nMatch a route on a router.\n\n### handler = router.start()\nReturn a function that can be passed directly to `http.createServer()` and\ncalls `router.match()`.\n\n## Installation\n```sh\n$ npm install server-router\n```\n\n## See Also\n- [wayfarer](https://github.com/yoshuawuyts/wayfarer) - vanilla radix-trie\n  router\n- [nanorouter](https://github.com/yoshuawuyts/nanorouter) - client-side\n  radix-trie router\n\n## License\n[MIT](https://tldrlegal.com/license/mit-license)\n\n[0]: https://img.shields.io/badge/stability-experimental-orange.svg?style=flat-square\n[1]: https://nodejs.org/api/documentation.html#documentation_stability_index\n[2]: https://img.shields.io/npm/v/server-router.svg?style=flat-square\n[3]: https://npmjs.org/package/server-router\n[4]: https://img.shields.io/travis/yoshuawuyts/server-router/master.svg?style=flat-square\n[5]: https://travis-ci.org/yoshuawuyts/server-router\n[6]: https://img.shields.io/codecov/c/github/yoshuawuyts/server-router/master.svg?style=flat-square\n[7]: https://codecov.io/github/yoshuawuyts/server-router\n[8]: http://img.shields.io/npm/dm/server-router.svg?style=flat-square\n[9]: https://npmjs.org/package/server-router\n[10]: https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat-square\n[11]: https://github.com/feross/standard\n[12]: https://github.com/yoshuawuyts/wayfarer\n","publish_time":1497640769691,"_cnpm_publish_time":1497640769691,"dist-tags":{"latest":"6.1.0"}}