{"_id":"redirects","_rev":"1745724","name":"redirects","description":"Express/Connect middleware for segment-able url redirects","dist-tags":{"latest":"1.1.1"},"maintainers":[{"name":"scottcorgan","email":"scottcorgan@gmail.com"}],"time":{"modified":"2026-11-19T14:29:55.000Z","created":"2014-07-18T17:24:24.109Z","1.1.1":"2015-02-26T19:14:02.529Z","1.1.0":"2015-02-24T19:26:17.465Z","1.0.0":"2014-11-18T22:29:52.997Z","0.2.0":"2014-07-18T17:24:24.109Z"},"users":{},"author":{"name":"Divshot"},"repository":{"type":"git","url":"git@github.com:divshot/redirects.git"},"versions":{"1.1.1":{"name":"redirects","version":"1.1.1","description":"Express/Connect middleware for segment-able url redirects","main":"index.js","directories":{"test":"test"},"scripts":{"test":"mocha test/ --reporter dot"},"repository":{"type":"git","url":"git@github.com:divshot/redirects.git"},"keywords":["superstatic","redirects","301","static","divshot"],"author":{"name":"Divshot"},"license":"MIT","bugs":{"url":"https://github.com/divshot/redirects/issues"},"homepage":"https://github.com/divshot/redirects","devDependencies":{"connect":"^3.3.3","mocha":"^2.0.1","supertest":"^0.15.0"},"dependencies":{"glob-slasher":"^1.0.0","globject":"^1.0.0","is-url":"^1.2.0","lodash.isobject":"^3.0.0","pathematics":"^0.1.1","toxic":"^1.0.0"},"gitHead":"b69d39dcdfed45c73ae688a93ebf53ea9e150188","_id":"redirects@1.1.1","_shasum":"0ca1e85f862675e8b6038c5687a922fa804c6e64","_from":".","_npmVersion":"2.5.1","_nodeVersion":"0.12.0","_npmUser":{"name":"scottcorgan","email":"scottcorgan@gmail.com"},"maintainers":[{"name":"scottcorgan","email":"scottcorgan@gmail.com"}],"dist":{"shasum":"0ca1e85f862675e8b6038c5687a922fa804c6e64","tarball":"http://registry-npm.ywwl.com/redirects/download/redirects-1.1.1.tgz","integrity":"sha512-VdDE/LP0d4hbv9WlIeplIdOlw/Cea7VQEXkYPEuLTLh6wWFKcINP1CofOe3SPQQ1M9mW00YEsP8IuX4axbWQaw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEW0W8XTtRa6w6BpeXD+Ua9BfauxbRMXFhTXucElOkmjAiEArAjDL/GaYnKkea/1H4gX9eJ5KTUDTj8s9M7rMSrtWmw="}],"size":2871,"noattachment":false,"key":"/redirects/-/redirects-1.1.1.tgz"},"publish_time":1424978042529,"_cnpm_publish_time":1424978042529},"1.1.0":{"name":"redirects","version":"1.1.0","description":"Express/Connect middleware for segment-able url redirects","main":"index.js","directories":{"test":"test"},"scripts":{"test":"mocha test/ --reporter dot"},"repository":{"type":"git","url":"git@github.com:divshot/redirects.git"},"keywords":["superstatic","redirects","301","static","divshot"],"author":{"name":"Divshot"},"license":"MIT","bugs":{"url":"https://github.com/divshot/redirects/issues"},"homepage":"https://github.com/divshot/redirects","devDependencies":{"connect":"^3.3.3","mocha":"^2.0.1","supertest":"^0.15.0"},"dependencies":{"glob-slasher":"^1.0.0","globject":"^1.0.0","is-url":"^1.2.0","lodash.isobject":"^3.0.0","pathematics":"^0.1.1","toxic":"^1.0.0"},"gitHead":"eb31eb1793ddefbd631886ccb4b6b443e4ba1df4","_id":"redirects@1.1.0","_shasum":"36fee85fdee782725b7dc42a42d8ad2d14455fb5","_from":".","_npmVersion":"2.4.1","_nodeVersion":"0.10.36","_npmUser":{"name":"scottcorgan","email":"scottcorgan@gmail.com"},"maintainers":[{"name":"scottcorgan","email":"scottcorgan@gmail.com"}],"dist":{"shasum":"36fee85fdee782725b7dc42a42d8ad2d14455fb5","tarball":"http://registry-npm.ywwl.com/redirects/download/redirects-1.1.0.tgz","integrity":"sha512-X+VFJVjOPLJH20+FdT7RJyEzBfmSuIDBKTf6BzbWY+gCRjsWwCmXVysaBCdxDLIeXWuNZ3ADyQJwWjQWCBgBWg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCAZ6zJ8A0mpDweiamvpaddwsKSeHN/VXHke9A4YrPccAIhAJJekzd2RXFHIaMy6jNLIFYIIYxcwmCXzf4WdoTreRSW"}],"size":2832,"noattachment":false,"key":"/redirects/-/redirects-1.1.0.tgz"},"publish_time":1424805977465,"_cnpm_publish_time":1424805977465},"1.0.0":{"name":"redirects","version":"1.0.0","description":"Express/Connect middleware for segment-able url redirects","main":"index.js","directories":{"test":"test"},"scripts":{"test":"mocha test/ --reporter dot"},"repository":{"type":"git","url":"git@github.com:divshot/redirects.git"},"keywords":["superstatic","redirects","301","static","divshot"],"author":{"name":"Divshot"},"license":"MIT","bugs":{"url":"https://github.com/divshot/redirects/issues"},"homepage":"https://github.com/divshot/redirects","devDependencies":{"connect":"^3.3.3","mocha":"^2.0.1","supertest":"^0.15.0"},"dependencies":{"glob-slasher":"^1.0.0","globject":"^1.0.0","lodash.isobject":"^2.4.1","pathematics":"^0.1.1","toxic":"^1.0.0"},"gitHead":"e65d2b3d927824cfbb4229b8b6bc3f9837b66ea3","_id":"redirects@1.0.0","_shasum":"24738046c225583d14788dfd5f603b79a8f5728a","_from":".","_npmVersion":"2.1.4","_nodeVersion":"0.10.31","_npmUser":{"name":"scottcorgan","email":"scottcorgan@gmail.com"},"maintainers":[{"name":"scottcorgan","email":"scottcorgan@gmail.com"}],"dist":{"shasum":"24738046c225583d14788dfd5f603b79a8f5728a","tarball":"http://registry-npm.ywwl.com/redirects/download/redirects-1.0.0.tgz","integrity":"sha512-wFiMVRfRRYrRlYrY3RbCCEIlcqzY3YlkMjlShQx/eg9rwJ9oVZ+JhwV8MCxaZW5naagzAYd4WtoQx9bckAUtzQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHqyiPHCk6h/xFx6GmZWnNTdbBodVr3ogoCvvc+NLcW1AiEA9r3iYZ4NZovIlixwgHFIdBEcmHwwBA0ys7rDLXW5SAM="}],"size":2714,"noattachment":false,"key":"/redirects/-/redirects-1.0.0.tgz"},"publish_time":1416349792997,"_cnpm_publish_time":1416349792997},"0.2.0":{"name":"redirects","version":"0.2.0","description":"Express/Connect middleware for segment-able url redirects","main":"index.js","directories":{"test":"test"},"scripts":{"test":"mocha test/ --reporter dot"},"repository":{"type":"git","url":"git@github.com:divshot/redirects.git"},"keywords":["superstatic","redirects","301","static","divshot"],"author":{"name":"Divshot"},"license":"MIT","bugs":{"url":"https://github.com/divshot/redirects/issues"},"homepage":"https://github.com/divshot/redirects","devDependencies":{"chai":"^1.9.1","connect":"^3.0.2","mocha":"^1.20.1","supertest":"^0.13.0"},"dependencies":{"globject":"^0.1.3","lodash.isobject":"^2.4.1","pathematics":"^0.1.1","slasher":"^0.1.5"},"gitHead":"da4bd65d980dea8c5e1e3b7c6473f02daddc6905","_id":"redirects@0.2.0","_shasum":"09c79c91645c5f69462e9c0e5c3f2a3ed433d932","_from":".","_npmVersion":"1.4.20","_npmUser":{"name":"scottcorgan","email":"scottcorgan@gmail.com"},"maintainers":[{"name":"scottcorgan","email":"scottcorgan@gmail.com"}],"dist":{"shasum":"09c79c91645c5f69462e9c0e5c3f2a3ed433d932","tarball":"http://registry-npm.ywwl.com/redirects/download/redirects-0.2.0.tgz","integrity":"sha512-/iSLR9QzU6/gDzSKU+OUwktAk0mcgb6r8fYNiU1QvnCrq6CkfBrfnt7AaVDVOmeGS5pRqtYt+p+RBpUrznf6NA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC8AzePphNd8xfF+ye6I0RLJ7rn51WYtiTrb+IuIl74zwIhAOWwMn13OdaW7zWpQPe4TGvsSAQCK2QWoAjH4f4NQltT"}],"size":2674,"noattachment":false,"key":"/redirects/-/redirects-0.2.0.tgz"},"publish_time":1405704264109,"_cnpm_publish_time":1405704264109}},"readme":"# redirects\n\nExpress/Connect middleware for segment-able url redirects\n\n## Install\n\n```\nnpm install redirects --save\n```\n\n## Usage\n\n```js\nvar http = require('http');\nvar connect = require('connect');\nvar redirects = require('redirects');\n\nvar app = connect();\n\napp.use(redirects({\n  '/some-url': '/redirected-url'  \n}));\n\nhttp.createServer(app).listen(3000, function (err) {\n  \n});\n```\n\n## Usage Options\n\n### Basic redirect\n\n```js\nvar connect = require('connect');\nvar redirects = require('redirects');\n\nvar app = connect();\n\napp.use(redirects({\n  '/some-url': '/redirected-url'  \n}));\n\nhttp.createServer(app).listen(3000, function (err) {\n  \n});\n```\n\n### Redirect with custom status code\n\n```js\nvar connect = require('connect');\nvar redirects = require('redirects');\n\nvar app = connect();\n\napp.use(redirects({\n  '/some-url': {\n    status: 302,\n    url: '/redirect-url'\n  }\n}));\n\nhttp.createServer(app).listen(3000, function (err) {\n  \n});\n```\n\n### Segmented value redirect\n\nAny value in the url that begins with a `:` will be considered a segment. This segment will replace the same value in the redirect url. This usage also works like the cusotm status codes example.\n\n```js\nvar connect = require('connect');\nvar redirects = require('redirects');\n\nvar app = connect();\n\napp.use(redirects({\n  // \"/old/test/path/here\" would redirect to \"/new/test/path/here\"\n  '/old/:value/path/:loc': '/new/:value/path/:loc'\n}));\n\nhttp.createServer(app).listen(3000, function (err) {\n  \n});\n```\n\n## Run Tests\n\n```\nnpm install\nnpm test\n```\n","_attachments":{},"homepage":"https://github.com/divshot/redirects","bugs":{"url":"https://github.com/divshot/redirects/issues"},"license":"MIT"}