https://github.com/markwylde/write-response
Send a response to a native node http(s) response object
https://github.com/markwylde/write-response
http https response
Last synced: about 1 month ago
JSON representation
Send a response to a native node http(s) response object
- Host: GitHub
- URL: https://github.com/markwylde/write-response
- Owner: markwylde
- License: mit
- Created: 2019-11-20T10:34:18.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2023-08-01T15:41:53.000Z (almost 3 years ago)
- Last Synced: 2026-01-03T02:43:10.300Z (6 months ago)
- Topics: http, https, response
- Language: JavaScript
- Homepage:
- Size: 140 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# write-response
Send a response to a native node http(s) response object
## Example Usage
### json
```javascript
import writeResponse from 'write-response';
writeResponse(200, { hello: 'all good here' }, response);
```
### text
```javascript
import writeResponse from 'write-response';
writeResponse(200, 'all good here', response);
```
### with headers
```javascript
import writeResponse from 'write-response';
writeResponse(200, 'HELLO', { 'Content-Type': 'text/html' }, response);
```
## License
This project is licensed under the terms of the MIT license.