send-response
Send HTTP responses.
Install
npm install --save send-response
Usage
var intoStream = var json = var html = var text = var error = var redirect = // send a text response { } // stream text to the response { var stream = } // respond with json { } // stream json to the response { var stream = intoStream } // respond with html { } // stream html to the response { var stream = } // redirect a request to another url { } // example of redirected handler { } // send an error response with JSON: { statusCode: 404, message: 'Not Found' } { }
Examples
Contributing
Contributions are welcome! Please read the contributing guidelines first.
Conduct
It's important that this project contributes to a friendly, safe, and welcoming environment for all, particularly for folks that are historically underrepresented in technology. Read this project's code of conduct
Change log
Read about the changes to this project in CHANGELOG.md. The format is based on Keep a Changelog and this project adheres to Semantic Versioning.
Contact
- issues – Please open issues in the issues queue