https://github.com/tiaanduplessis/enhance-res
Enhance http.ServerResponse object
https://github.com/tiaanduplessis/enhance-res
enhance improve response
Last synced: 11 months ago
JSON representation
Enhance http.ServerResponse object
- Host: GitHub
- URL: https://github.com/tiaanduplessis/enhance-res
- Owner: tiaanduplessis
- License: mit
- Created: 2017-08-04T10:23:03.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2020-06-07T03:17:08.000Z (about 6 years ago)
- Last Synced: 2025-06-22T07:43:59.243Z (about 1 year ago)
- Topics: enhance, improve, response
- Language: JavaScript
- Size: 61.5 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
enhance-res
Enhance http.ServerResponse object
Table of Contents
Table of Contents
## Install
```sh
$ npm install enhance-res
# OR
$ yarn add enhance-res
```
## Usage
```js
const http = require('http')
const enhanceRes = require('enhance-res')
http.createServer((req, res) => {
enhanceRes(res)
res.send({test: true})
// res.send(new Buffer('Test'))
// res.error(new Error('Oops'))
// res.status(201).send({test: true})
// res.redirect('http://google.com)
// res.html('
Hi
)}).listen(5000)
```
## Contributing
Contributions are welcome!
1. Fork it.
2. Create your feature branch: `git checkout -b my-new-feature`
3. Commit your changes: `git commit -am 'Add some feature'`
4. Push to the branch: `git push origin my-new-feature`
5. Submit a pull request :D
Or open up [a issue](https://github.com/tiaanduplessis/enhance-res/issues).
## License
Licensed under the MIT License.