{"_id":"expres","_rev":"14-c62f663ee9040d5fa3bc55b4b5adbd12","name":"expres","description":"Add express compatible methods to your response object","dist-tags":{"latest":"0.0.5"},"versions":{"0.0.1":{"name":"expres","version":"0.0.1","description":"Add express compatible methods to your response object","main":"expres.js","dependencies":{},"devDependencies":{"mocha":"*","supertest":"~0.3.1","clone":"~0.1.1"},"scripts":{"test":"make test"},"repository":{"type":"git","url":"git://github.com/cpsubrian/node-expres.git"},"homepage":"https://github.com/cpsubrian/node-expres","keywords":["res","response","express","middleware"],"author":{"name":"Brian Link","email":"cpsubrian@gmail.com"},"license":"MIT","readme":"expRes\n======\n\nMiddleware to add express compatible methods to your response objects.\n\n[![build status](https://secure.travis-ci.org/cpsubrian/node-expres.png)](http://travis-ci.org/cpsubrian/node-expres)\n\nUsage\n-----\n\n```js\nvar expres = require('expres'),\n    server = require('http').createServer();\n\nserver.on('request', expres.middleware);\n\n// ...\n```\n\nResponse Methods Added\n----------------------\n\n### status(code)\nSet status `code`.\n@param {Number} code\n@return {ServerResponse}\n\n### links(links)\n\nSet Link header field with the given `links`.\n\n    res.links({\n      next: 'http://api.example.com/users?page=2',\n      last: 'http://api.example.com/users?page=5'\n    });\n\n### type(type)\n\nSet the Content-Type to `type`.\n\n    res.type('application/json');\n\n### send(body|status, [body])\n\nSend a response.\n\n    res.send(new Buffer('wahoo'));\n    res.send({ some: 'json' });\n    res.send('<p>some html</p>');\n    res.send(404, 'Sorry, cant find that');\n    res.send(404);\n\n### json(obj|status, [obj])\n\nSend JSON response.\n\n    res.json(null);\n    res.json({ user: 'tj' });\n    res.json(500, 'oh noes!');\n    res.json(404, 'I dont have that');\n\n### jsonp(obj|status, [obj])\n\nSend JSON response with JSONP callback support.\n\n    res.jsonp(null);\n    res.jsonp({ user: 'tj' });\n    res.jsonp(500, 'oh noes!');\n    res.jsonp(404, 'I dont have that');\n\n### format(obj)\n\nRespond to the Acceptable formats using an `obj`\nof content-type callbacks.\n\nContent-Type is set for you, however if you choose\nyou may alter this within the callback using `res.type()`\nor `res.set('Content-Type', ...)`.\n\n    res.format({\n      'text/plain'(){\n        res.send('hey');\n      },\n      'text/html'(){\n        res.send('<p>hey</p>');\n      },\n      'appliation/json'(){\n        res.send({ message: 'hey' });\n      }\n    });\n\nBy default expres passes an `Error`\nwith a `.status` of 406 to `next(err)`\nif a match is not made. If you provide\na `.default` callback it will be invoked\ninstead.\n\n### set(field, [val])\n\nSet header `field` to `val`, or pass\nan object of header fields.\n\n    res.set('Accept', 'application/json');\n    res.set({ Accept: 'text/plain', 'X-API-Key': 'tobi' });\n\nAliased as `res.header()`.\n\n### get(field)\n\nGet value for header `field`.\n\n### redirect(toUrl, [status])\n\nRedirect to the given `url` with optional response `status`\ndefaulting to 302.\n\nThe given `url` can also be the name of a mapped url, for\nexample by default expres supports \"back\" which redirects\nto the _Referrer_ or _Referer_ headers or \"/\".\n\n    res.redirect('/foo/bar');\n    res.redirect('http://example.com');\n    res.redirect(301, 'http://example.com');\n    res.redirect('http://example.com', 301);\n    res.redirect('../login'); // /blog/post/1 -> /blog/login\n\n\nCredit\n------\n\nMany of the methods and tests are copied verbatim from express, so, thanks TJ :)\n\n- - -\n\n### Developed by [Terra Eclipse](http://www.terraeclipse.com)\nTerra Eclipse, Inc. is a nationally recognized political technology and\nstrategy firm located in Aptos, CA and Washington, D.C.\n\n- - -\n\n### License: MIT\n\n- Copyright (C) 2012 Terra Eclipse, Inc. (http://www.terraeclipse.com/)\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the &quot;Software&quot;), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is furnished\nto do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED &quot;AS IS&quot;, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.","_id":"expres@0.0.1","dist":{"shasum":"e6340fd92c80b82df656564f04717ec871c6351c","tarball":"https://registry.npmjs.org/expres/-/expres-0.0.1.tgz","integrity":"sha512-9g7FUsqHsDWQe2jhuuBxaIiOzJb0nwmQw6NIfZbHCnYsoZRjyI6Zd0ZUJw9wqAfwkHZ2h/UDVzLVGOBvDH4CzQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCAio2DsGbuNAWjVJaBjS2nLPyKfUdUdQN7opM170u+uwIgbfQTEH/YkzMGNrYVqN6q9USRQDlI8UohE0n0VYDM0t4="}]},"_npmVersion":"1.1.62","_npmUser":{"name":"cpsubrian","email":"cpsubrian@gmail.com"},"maintainers":[{"name":"cpsubrian","email":"cpsubrian@gmail.com"}],"directories":{}},"0.0.2":{"name":"expres","version":"0.0.2","description":"Add express compatible methods to your response object","main":"expres.js","dependencies":{},"devDependencies":{"mocha":"*","supertest":"~0.3.1","clone":"~0.1.1"},"scripts":{"test":"make test"},"repository":{"type":"git","url":"git://github.com/cpsubrian/node-expres.git"},"homepage":"https://github.com/cpsubrian/node-expres","keywords":["res","response","express","middleware"],"author":{"name":"Brian Link","email":"cpsubrian@gmail.com"},"license":"MIT","readme":"expRes\n======\n\nMiddleware to add express compatible methods to your response objects.\n\n[![build status](https://secure.travis-ci.org/cpsubrian/node-expres.png)](http://travis-ci.org/cpsubrian/node-expres)\n\nUsage\n-----\n\n```js\nvar expres = require('expres'),\n    server = require('http').createServer();\n\nserver.on('request', expres.middleware);\n\n// ...\n```\n\nResponse Methods Added\n----------------------\n\n### status(code)\nSet status `code`.\n@param {Number} code\n@return {ServerResponse}\n\n### links(links)\n\nSet Link header field with the given `links`.\n\n    res.links({\n      next: 'http://api.example.com/users?page=2',\n      last: 'http://api.example.com/users?page=5'\n    });\n\n### type(type)\n\nSet the Content-Type to `type`.\n\n    res.type('application/json');\n\n### send(body|status, [body])\n\nSend a response.\n\n    res.send(new Buffer('wahoo'));\n    res.send({ some: 'json' });\n    res.send('<p>some html</p>');\n    res.send(404, 'Sorry, cant find that');\n    res.send(404);\n\n### json(obj|status, [obj])\n\nSend JSON response.\n\n    res.json(null);\n    res.json({ user: 'tj' });\n    res.json(500, 'oh noes!');\n    res.json(404, 'I dont have that');\n\n### jsonp(obj|status, [obj])\n\nSend JSON response with JSONP callback support.\n\n    res.jsonp(null);\n    res.jsonp({ user: 'tj' });\n    res.jsonp(500, 'oh noes!');\n    res.jsonp(404, 'I dont have that');\n\n### format(obj)\n\nRespond to the Acceptable formats using an `obj`\nof content-type callbacks.\n\nContent-Type is set for you, however if you choose\nyou may alter this within the callback using `res.type()`\nor `res.set('Content-Type', ...)`.\n\n    res.format({\n      'text/plain': function () {\n        res.send('hey');\n      },\n      'text/html': function () {\n        res.send('<p>hey</p>');\n      },\n      'appliation/json': function () {\n        res.send({ message: 'hey' });\n      }\n    });\n\nBy default expres passes an `Error`\nwith a `.status` of 406 to `next(err)`\nif a match is not made. If you provide\na `.default` callback it will be invoked\ninstead.\n\n### set(field, [val])\n\nSet header `field` to `val`, or pass\nan object of header fields.\n\n    res.set('Accept', 'application/json');\n    res.set({ Accept: 'text/plain', 'X-API-Key': 'tobi' });\n\nAliased as `res.header()`.\n\n### get(field)\n\nGet value for header `field`.\n\n### redirect(toUrl, [status])\n\nRedirect to the given `url` with optional response `status`\ndefaulting to 302.\n\nThe given `url` can also be the name of a mapped url, for\nexample by default expres supports \"back\" which redirects\nto the _Referrer_ or _Referer_ headers or \"/\".\n\n    res.redirect('/foo/bar');\n    res.redirect('http://example.com');\n    res.redirect(301, 'http://example.com');\n    res.redirect('http://example.com', 301);\n    res.redirect('../login'); // /blog/post/1 -> /blog/login\n\n\nCredit\n------\n\nMany of the methods and tests are copied verbatim from express, so, thanks TJ :)\n\n- - -\n\n### Developed by [Terra Eclipse](http://www.terraeclipse.com)\nTerra Eclipse, Inc. is a nationally recognized political technology and\nstrategy firm located in Aptos, CA and Washington, D.C.\n\n- - -\n\n### License: MIT\n\n- Copyright (c) 2009-2012 TJ Holowaychuk <tj@vision-media.ca>\n- Copyright (C) 2012 Terra Eclipse, Inc. (http://www.terraeclipse.com/)\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the &quot;Software&quot;), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is furnished\nto do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED &quot;AS IS&quot;, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.","_id":"expres@0.0.2","dist":{"shasum":"05070b77dbbadd6fc5c6c3dd328c0afdb5fe9fd2","tarball":"https://registry.npmjs.org/expres/-/expres-0.0.2.tgz","integrity":"sha512-ykmLqZvvrF0mdLB6+AhixAgPuugxEa2jRHkzxS75MlFs23Kb3/+S39tTYLYyTt/DUhjHZTcl1JYOaDrmLo6/AQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICnQqgRmbi1EZQW8HrmECCeHuz4JFt0udWpquIVuQaTzAiBPH0DeCXKVFwy9uaCdPAuS7gB993XHPf9u7tsyMlWVXg=="}]},"_npmVersion":"1.1.62","_npmUser":{"name":"cpsubrian","email":"cpsubrian@gmail.com"},"maintainers":[{"name":"cpsubrian","email":"cpsubrian@gmail.com"}],"directories":{}},"0.0.3":{"name":"expres","version":"0.0.3","description":"Add express compatible methods to your response object","main":"expres.js","dependencies":{},"devDependencies":{"mocha":"*","supertest":"~0.3.1","clone":"~0.1.1"},"scripts":{"test":"make test"},"repository":{"type":"git","url":"git://github.com/cpsubrian/node-expres.git"},"homepage":"https://github.com/cpsubrian/node-expres","keywords":["res","response","express","middleware"],"author":{"name":"Brian Link","email":"cpsubrian@gmail.com"},"license":"MIT","readme":"expRes\n======\n\nMiddleware to add express compatible methods to your response objects.\n\n[![build status](https://secure.travis-ci.org/cpsubrian/node-expres.png)](http://travis-ci.org/cpsubrian/node-expres)\n\nUsage\n-----\n\n```js\nvar expres = require('expres'),\n    server = require('http').createServer();\n\nserver.on('request', expres.middleware);\n\n// ...\n```\n\nResponse Methods Added\n----------------------\n\n### status(code)\nSet status `code`.\n\n    res.status(400);\n\n### links(links)\n\nSet Link header field with the given `links`.\n\n    res.links({\n      next: 'http://api.example.com/users?page=2',\n      last: 'http://api.example.com/users?page=5'\n    });\n\n### type(type)\n\nSet the Content-Type to `type`.\n\n    res.type('application/json');\n\n### send(body|status, [body])\n\nSend a response.\n\n    res.send(new Buffer('wahoo'));\n    res.send({ some: 'json' });\n    res.send('<p>some html</p>');\n    res.send(404, 'Sorry, cant find that');\n    res.send(404);\n\n### json(obj|status, [obj])\n\nSend JSON response.\n\n    res.json(null);\n    res.json({ user: 'tj' });\n    res.json(500, 'oh noes!');\n    res.json(404, 'I dont have that');\n\n### jsonp(obj|status, [obj])\n\nSend JSON response with JSONP callback support.\n\n    res.jsonp(null);\n    res.jsonp({ user: 'tj' });\n    res.jsonp(500, 'oh noes!');\n    res.jsonp(404, 'I dont have that');\n\n### format(obj)\n\nRespond to the Acceptable formats using an `obj`\nof content-type callbacks.\n\nContent-Type is set for you, however if you choose\nyou may alter this within the callback using `res.type()`\nor `res.set('Content-Type', ...)`.\n\n    res.format({\n      'text/plain': function () {\n        res.send('hey');\n      },\n      'text/html': function () {\n        res.send('<p>hey</p>');\n      },\n      'appliation/json': function () {\n        res.send({ message: 'hey' });\n      }\n    });\n\nBy default expres passes an `Error`\nwith a `.status` of 406 to `next(err)`\nif a match is not made. If you provide\na `.default` callback it will be invoked\ninstead.\n\n### set(field, [val])\n\nSet header `field` to `val`, or pass\nan object of header fields.\n\n    res.set('Accept', 'application/json');\n    res.set({ Accept: 'text/plain', 'X-API-Key': 'tobi' });\n\nAliased as `res.header()`.\n\n### get(field)\n\nGet value for header `field`.\n\n### redirect(toUrl, [status])\n\nRedirect to the given `url` with optional response `status`\ndefaulting to 302.\n\nThe given `url` can also be the name of a mapped url, for\nexample by default expres supports \"back\" which redirects\nto the _Referrer_ or _Referer_ headers or \"/\".\n\n    res.redirect('/foo/bar');\n    res.redirect('http://example.com');\n    res.redirect(301, 'http://example.com');\n    res.redirect('http://example.com', 301);\n    res.redirect('../login'); // /blog/post/1 -> /blog/login\n\n\nCredit\n------\n\nMany of the methods and tests are copied verbatim from express, so, thanks TJ :)\n\n- - -\n\n### Developed by [Terra Eclipse](http://www.terraeclipse.com)\nTerra Eclipse, Inc. is a nationally recognized political technology and\nstrategy firm located in Aptos, CA and Washington, D.C.\n\n- - -\n\n### License: MIT\n\n- Copyright (c) 2009-2012 TJ Holowaychuk <tj@vision-media.ca>\n- Copyright (C) 2012 Terra Eclipse, Inc. (http://www.terraeclipse.com/)\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the &quot;Software&quot;), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is furnished\nto do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED &quot;AS IS&quot;, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.","_id":"expres@0.0.3","dist":{"shasum":"100c7941911743ad63c18b026f31c3a4267004ae","tarball":"https://registry.npmjs.org/expres/-/expres-0.0.3.tgz","integrity":"sha512-0amE8LY4/rrCvOm/szQkX5BAyYEIqxkqLTKNRAZ+jOQYnMU3jvonzME+0PSKKRy6wL0GpvVR8uZ06HK0aqclqQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC0Odhrq/xRRllc77qGiBVe8N/3U/omSpeBKu26H1yKogIgJXyLorKnqx+n1K1HgY4f3oq7j055zlY6teRhc2moeGM="}]},"_npmVersion":"1.1.62","_npmUser":{"name":"cpsubrian","email":"cpsubrian@gmail.com"},"maintainers":[{"name":"cpsubrian","email":"cpsubrian@gmail.com"}],"directories":{}},"0.0.4":{"name":"expres","version":"0.0.4","description":"Add express compatible methods to your response object","main":"expres.js","dependencies":{},"devDependencies":{"mocha":"*","supertest":"~0.3.1","clone":"~0.1.1"},"scripts":{"test":"make test"},"repository":{"type":"git","url":"git://github.com/cpsubrian/node-expres.git"},"homepage":"https://github.com/cpsubrian/node-expres","keywords":["res","response","express","middleware"],"author":{"name":"Brian Link","email":"cpsubrian@gmail.com"},"license":"MIT","readme":"expRes\n======\n\nMiddleware to add express compatible methods to your response objects.\n\n[![build status](https://secure.travis-ci.org/cpsubrian/node-expres.png)](http://travis-ci.org/cpsubrian/node-expres)\n\nUsage\n-----\n\n```js\nvar expres = require('expres'),\n    server = require('http').createServer();\n\nserver.on('request', expres.middleware);\n\n// ...\n```\n\nResponse Methods Added\n----------------------\n\n### status(code)\nSet status `code`.\n\n    res.status(400);\n\n### links(links)\n\nSet Link header field with the given `links`.\n\n    res.links({\n      next: 'http://api.example.com/users?page=2',\n      last: 'http://api.example.com/users?page=5'\n    });\n\n### type(type)\n\nSet the Content-Type to `type`.\n\n    res.type('application/json');\n\n### send(body|status, [body])\n\nSend a response.\n\n    res.send(new Buffer('wahoo'));\n    res.send({ some: 'json' });\n    res.send('<p>some html</p>');\n    res.send(404, 'Sorry, cant find that');\n    res.send(404);\n\n### json(obj|status, [obj])\n\nSend JSON response.\n\n    res.json(null);\n    res.json({ user: 'tj' });\n    res.json(500, 'oh noes!');\n    res.json(404, 'I dont have that');\n\n### jsonp(obj|status, [obj])\n\nSend JSON response with JSONP callback support.\n\n    res.jsonp(null);\n    res.jsonp({ user: 'tj' });\n    res.jsonp(500, 'oh noes!');\n    res.jsonp(404, 'I dont have that');\n\n### format(obj)\n\nRespond to the Acceptable formats using an `obj`\nof content-type callbacks.\n\nContent-Type is set for you, however if you choose\nyou may alter this within the callback using `res.type()`\nor `res.set('Content-Type', ...)`.\n\n    res.format({\n      'text/plain': function () {\n        res.send('hey');\n      },\n      'text/html': function () {\n        res.send('<p>hey</p>');\n      },\n      'appliation/json': function () {\n        res.send({ message: 'hey' });\n      }\n    });\n\nBy default expres passes an `Error`\nwith a `.status` of 406 to `next(err)`\nif a match is not made. If you provide\na `.default` callback it will be invoked\ninstead.\n\n### set(field, [val])\n\nSet header `field` to `val`, or pass\nan object of header fields.\n\n    res.set('Accept', 'application/json');\n    res.set({ Accept: 'text/plain', 'X-API-Key': 'tobi' });\n\nAliased as `res.header()`.\n\n### get(field)\n\nGet value for header `field`.\n\n### redirect(toUrl, [status])\n\nRedirect to the given `url` with optional response `status`\ndefaulting to 302.\n\nThe given `url` can also be the name of a mapped url, for\nexample by default expres supports \"back\" which redirects\nto the _Referrer_ or _Referer_ headers or \"/\".\n\n    res.redirect('/foo/bar');\n    res.redirect('http://example.com');\n    res.redirect(301, 'http://example.com');\n    res.redirect('http://example.com', 301);\n    res.redirect('../login'); // /blog/post/1 -> /blog/login\n\n\nCredit\n------\n\nMany of the methods and tests are copied verbatim from express, so, thanks TJ :)\n\n- - -\n\n### Developed by [Terra Eclipse](http://www.terraeclipse.com)\nTerra Eclipse, Inc. is a nationally recognized political technology and\nstrategy firm located in Aptos, CA and Washington, D.C.\n\n- - -\n\n### License: MIT\n\n- Copyright (c) 2009-2012 TJ Holowaychuk <tj@vision-media.ca>\n- Copyright (C) 2012 Terra Eclipse, Inc. (http://www.terraeclipse.com/)\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the &quot;Software&quot;), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is furnished\nto do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED &quot;AS IS&quot;, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.","_id":"expres@0.0.4","dist":{"shasum":"78addd129433ec66bfabdb7d15b1db6e62f15910","tarball":"https://registry.npmjs.org/expres/-/expres-0.0.4.tgz","integrity":"sha512-IVQjf5Cow4JSMEKsUyrLIXaJCq8puvbPoZH7Ha6yc75KCtLRbCAZLDVZ/OOMzDFJrzIkKzpNqyBkKMPXJn2ncg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDs4JFfLzh1RLWGHz5M7Cv+fjQFM6hgfkCJjzKKlIHmuAiAVqEHopqQ/WnAFpclVR3WMHcyCiT8CtDw6D21BRXO1Wg=="}]},"_npmVersion":"1.1.62","_npmUser":{"name":"cpsubrian","email":"cpsubrian@gmail.com"},"maintainers":[{"name":"cpsubrian","email":"cpsubrian@gmail.com"}],"directories":{}},"0.0.5":{"name":"expres","version":"0.0.5","description":"Add express compatible methods to your response object","main":"expres.js","dependencies":{},"devDependencies":{"mocha":"*","supertest":"~0.3.1","clone":"~0.1.1"},"scripts":{"test":"make test"},"repository":{"type":"git","url":"git://github.com/cpsubrian/node-expres.git"},"homepage":"https://github.com/cpsubrian/node-expres","keywords":["res","response","express","middleware"],"author":{"name":"Brian Link","email":"cpsubrian@gmail.com"},"license":"MIT","readme":"expRes\n======\n\nMiddleware to add express compatible methods to your response objects.\n\n[![build status](https://secure.travis-ci.org/cpsubrian/node-expres.png)](http://travis-ci.org/cpsubrian/node-expres)\n\nUsage\n-----\n\n```js\nvar expres = require('expres'),\n    server = require('http').createServer();\n\nserver.on('request', expres.middleware);\n\n// ...\n```\n\nResponse Methods Added\n----------------------\n\n### status(code)\nSet status `code`.\n\n    res.status(400);\n\n### links(links)\n\nSet Link header field with the given `links`.\n\n    res.links({\n      next: 'http://api.example.com/users?page=2',\n      last: 'http://api.example.com/users?page=5'\n    });\n\n### type(type)\n\nSet the Content-Type to `type`.\n\n    res.type('application/json');\n\n### send(body|status, [body])\n\nSend a response.\n\n    res.send(new Buffer('wahoo'));\n    res.send({ some: 'json' });\n    res.send('<p>some html</p>');\n    res.send(404, 'Sorry, cant find that');\n    res.send(404);\n\n### json(obj|status, [obj])\n\nSend JSON response.\n\n    res.json(null);\n    res.json({ user: 'tj' });\n    res.json(500, 'oh noes!');\n    res.json(404, 'I dont have that');\n\n### jsonp(obj|status, [obj])\n\nSend JSON response with JSONP callback support.\n\n    res.jsonp(null);\n    res.jsonp({ user: 'tj' });\n    res.jsonp(500, 'oh noes!');\n    res.jsonp(404, 'I dont have that');\n\n### format(obj)\n\nRespond to the Acceptable formats using an `obj`\nof content-type callbacks.\n\nContent-Type is set for you, however if you choose\nyou may alter this within the callback using `res.type()`\nor `res.set('Content-Type', ...)`.\n\n    res.format({\n      'text/plain': function () {\n        res.send('hey');\n      },\n      'text/html': function () {\n        res.send('<p>hey</p>');\n      },\n      'appliation/json': function () {\n        res.send({ message: 'hey' });\n      }\n    });\n\nBy default expres passes an `Error`\nwith a `.status` of 406 to `next(err)`\nif a match is not made. If you provide\na `.default` callback it will be invoked\ninstead.\n\n### set(field, [val])\n\nSet header `field` to `val`, or pass\nan object of header fields.\n\n    res.set('Accept', 'application/json');\n    res.set({ Accept: 'text/plain', 'X-API-Key': 'tobi' });\n\nAliased as `res.header()`.\n\n### get(field)\n\nGet value for header `field`.\n\n### redirect(toUrl, [status])\n\nRedirect to the given `url` with optional response `status`\ndefaulting to 302.\n\nThe given `url` can also be the name of a mapped url, for\nexample by default expres supports \"back\" which redirects\nto the _Referrer_ or _Referer_ headers or \"/\".\n\n    res.redirect('/foo/bar');\n    res.redirect('http://example.com');\n    res.redirect(301, 'http://example.com');\n    res.redirect('http://example.com', 301);\n    res.redirect('../login'); // /blog/post/1 -> /blog/login\n\n\nCredit\n------\n\nMany of the methods and tests are copied verbatim from express, so, thanks TJ :)\n\n- - -\n\n### Developed by [Terra Eclipse](http://www.terraeclipse.com)\nTerra Eclipse, Inc. is a nationally recognized political technology and\nstrategy firm located in Aptos, CA and Washington, D.C.\n\n- - -\n\n### License: MIT\n\n- Copyright (c) 2009-2012 TJ Holowaychuk <tj@vision-media.ca>\n- Copyright (C) 2012 Terra Eclipse, Inc. (http://www.terraeclipse.com/)\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the &quot;Software&quot;), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is furnished\nto do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED &quot;AS IS&quot;, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.","readmeFilename":"README.md","bugs":{"url":"https://github.com/cpsubrian/node-expres/issues"},"_id":"expres@0.0.5","dist":{"shasum":"bf4484749f83920cb116d6baf6da230220d1fb9c","tarball":"https://registry.npmjs.org/expres/-/expres-0.0.5.tgz","integrity":"sha512-pK2yFc2Ke66rveH6iq6YJr63v55cFP6fs2xhoJ7RUGg+uwwApMlod3IwVm8zEtKH4ALqSvaGQF4cNemsyApd/w==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCeAGop/A9myvsK8ClkwqsvF4Kkv/7u2GrcnkSvPA5ITAIgK2QsHUSY6pXeFHWoofchp3Sb2Al6fMnSMqA9QERFOPc="}]},"_from":".","_npmVersion":"1.3.2","_npmUser":{"name":"cpsubrian","email":"cpsubrian@gmail.com"},"maintainers":[{"name":"cpsubrian","email":"cpsubrian@gmail.com"}],"directories":{}}},"readme":"expRes\n======\n\nMiddleware to add express compatible methods to your response objects.\n\n[![build status](https://secure.travis-ci.org/cpsubrian/node-expres.png)](http://travis-ci.org/cpsubrian/node-expres)\n\nUsage\n-----\n\n```js\nvar expres = require('expres'),\n    server = require('http').createServer();\n\nserver.on('request', expres.middleware);\n\n// ...\n```\n\nResponse Methods Added\n----------------------\n\n### status(code)\nSet status `code`.\n@param {Number} code\n@return {ServerResponse}\n\n### links(links)\n\nSet Link header field with the given `links`.\n\n    res.links({\n      next: 'http://api.example.com/users?page=2',\n      last: 'http://api.example.com/users?page=5'\n    });\n\n### type(type)\n\nSet the Content-Type to `type`.\n\n    res.type('application/json');\n\n### send(body|status, [body])\n\nSend a response.\n\n    res.send(new Buffer('wahoo'));\n    res.send({ some: 'json' });\n    res.send('<p>some html</p>');\n    res.send(404, 'Sorry, cant find that');\n    res.send(404);\n\n### json(obj|status, [obj])\n\nSend JSON response.\n\n    res.json(null);\n    res.json({ user: 'tj' });\n    res.json(500, 'oh noes!');\n    res.json(404, 'I dont have that');\n\n### jsonp(obj|status, [obj])\n\nSend JSON response with JSONP callback support.\n\n    res.jsonp(null);\n    res.jsonp({ user: 'tj' });\n    res.jsonp(500, 'oh noes!');\n    res.jsonp(404, 'I dont have that');\n\n### format(obj)\n\nRespond to the Acceptable formats using an `obj`\nof content-type callbacks.\n\nContent-Type is set for you, however if you choose\nyou may alter this within the callback using `res.type()`\nor `res.set('Content-Type', ...)`.\n\n    res.format({\n      'text/plain'(){\n        res.send('hey');\n      },\n      'text/html'(){\n        res.send('<p>hey</p>');\n      },\n      'appliation/json'(){\n        res.send({ message: 'hey' });\n      }\n    });\n\nBy default expres passes an `Error`\nwith a `.status` of 406 to `next(err)`\nif a match is not made. If you provide\na `.default` callback it will be invoked\ninstead.\n\n### set(field, [val])\n\nSet header `field` to `val`, or pass\nan object of header fields.\n\n    res.set('Accept', 'application/json');\n    res.set({ Accept: 'text/plain', 'X-API-Key': 'tobi' });\n\nAliased as `res.header()`.\n\n### get(field)\n\nGet value for header `field`.\n\n### redirect(toUrl, [status])\n\nRedirect to the given `url` with optional response `status`\ndefaulting to 302.\n\nThe given `url` can also be the name of a mapped url, for\nexample by default expres supports \"back\" which redirects\nto the _Referrer_ or _Referer_ headers or \"/\".\n\n    res.redirect('/foo/bar');\n    res.redirect('http://example.com');\n    res.redirect(301, 'http://example.com');\n    res.redirect('http://example.com', 301);\n    res.redirect('../login'); // /blog/post/1 -> /blog/login\n\n\nCredit\n------\n\nMany of the methods and tests are copied verbatim from express, so, thanks TJ :)\n\n- - -\n\n### Developed by [Terra Eclipse](http://www.terraeclipse.com)\nTerra Eclipse, Inc. is a nationally recognized political technology and\nstrategy firm located in Aptos, CA and Washington, D.C.\n\n- - -\n\n### License: MIT\n\n- Copyright (C) 2012 Terra Eclipse, Inc. (http://www.terraeclipse.com/)\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the &quot;Software&quot;), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is furnished\nto do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED &quot;AS IS&quot;, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.","maintainers":[{"name":"cpsubrian","email":"cpsubrian@gmail.com"}],"time":{"modified":"2022-06-17T22:06:27.898Z","created":"2012-10-10T03:49:52.879Z","0.0.1":"2012-10-10T03:49:54.420Z","0.0.2":"2012-10-10T17:56:13.666Z","0.0.3":"2012-10-10T18:10:02.210Z","0.0.4":"2012-10-25T21:27:15.851Z","0.0.5":"2013-07-16T23:16:37.336Z"},"author":{"name":"Brian Link","email":"cpsubrian@gmail.com"},"repository":{"type":"git","url":"git://github.com/cpsubrian/node-expres.git"},"users":{}}