{"name":"server-router","version":"2.0.1","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":{"methods":"^1.1.1","pathname-match":"^1.1.3","sliced":"^1.0.1","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":"^5.4.1","tape":"^4.2.2"},"files":["index.js","bin/*"],"gitHead":"e32f8f3142932ad1660803f3454d1b1719234a87","bugs":{"url":"https://github.com/yoshuawuyts/server-router/issues"},"homepage":"https://github.com/yoshuawuyts/server-router#readme","_id":"server-router@2.0.1","_shasum":"c8a7eedfa09a8fc9d3dd5afd6578193895754559","_from":".","_npmVersion":"2.15.1","_nodeVersion":"5.9.1","_npmUser":{"name":"yoshuawuyts","email":"i@yoshuawuyts.com"},"dist":{"shasum":"c8a7eedfa09a8fc9d3dd5afd6578193895754559","tarball":"http://registry-npm.ywwl.com/server-router/download/server-router-2.0.1.tgz","integrity":"sha512-8XsH25CGDGOlUxplQn24qLAEgVME/1VzfWRry6kWOJrs9c9ZJg1agnBS3TZK7f5X55TJt/ggJivyD7AfIUa0yg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIB7sRKxnqbjMGALw8EbX6irkp0GQIMXYs2R2iDbTVq9JAiEAuMCS6ylyXBzaQMsg5M86/2X8MzFp3UxSMamoViNEBIk="}],"size":3449,"noattachment":false,"key":"/server-router/-/server-router-2.0.1.tgz"},"maintainers":[{"name":"yoshuawuyts","email":"i@yoshuawuyts.com"}],"_npmOperationalInternal":{"host":"packages-16-east.internal.npmjs.com","tmp":"tmp/server-router-2.0.1.tgz_1460266691430_0.367318581789732"},"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":1460266693712,"_cnpm_publish_time":1460266693712,"dist-tags":{"latest":"6.1.0"}}