An open API service indexing awesome lists of open source software.

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

Awesome Lists containing this project

README

          

enhance-res



Enhance http.ServerResponse object





npm package version


npm downloads


standard JS linter


prettier code formatting


travis ci build status


project license


make a pull request






Github Watch Badge


Github Star Badge


Tweet





Built with ❤︎ by tiaanduplessis and contributors

Table of Contents

Table of Contents

  • Install

  • Usage

  • Contribute

  • License
  • ## 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.