{"name":"server-router","version":"1.0.2","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","sliced":"^1.0.1","wayfarer":"^6.1.0"},"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":"da5a9963e6d341e076ea885e0ee023404dde8111","bugs":{"url":"https://github.com/yoshuawuyts/server-router/issues"},"homepage":"https://github.com/yoshuawuyts/server-router#readme","_id":"server-router@1.0.2","_shasum":"d8210bcccc9c56ae33e945ee1e916ac70f7b5d09","_from":".","_npmVersion":"3.5.2","_nodeVersion":"5.0.0","_npmUser":{"name":"yoshuawuyts","email":"i@yoshuawuyts.com"},"dist":{"shasum":"d8210bcccc9c56ae33e945ee1e916ac70f7b5d09","tarball":"http://registry-npm.ywwl.com/server-router/download/server-router-1.0.2.tgz","integrity":"sha512-qvZBcSXFbxfUz+Vz6g19mtTyAz9JItogXSkuO0LWG6Y/TrWQVCJqMgNRgVx27qr6zloJg1vHw6Bwf1tdvzzOCw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIA91ernZjuB+BVogQzYzz+gWLwSqlrmVFpP7FKuRoIpDAiEAoZy4inY9vJpZUN34QWOE6H50FdNwDMmo3MJTEyowRe8="}],"size":2489,"noattachment":false,"key":"/server-router/-/server-router-1.0.2.tgz"},"maintainers":[{"name":"yoshuawuyts","email":"i@yoshuawuyts.com"}],"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":1454248654773,"_cnpm_publish_time":1454248654773,"dist-tags":{"latest":"6.1.0"}}