write-response
TypeScript icon, indicating that this package has built-in type declarations

2.0.2 • Public • Published

write-response

Send a response to a native node http(s) response object

Example Usage

json

import writeResponse from 'write-response';
writeResponse(200, { hello: 'all good here' }, response);

text

import writeResponse from 'write-response';
writeResponse(200, 'all good here', response);

with headers

import writeResponse from 'write-response';
writeResponse(200, '<strong>HELLO</strong>', { 'Content-Type': 'text/html' }, response);

License

This project is licensed under the terms of the MIT license.

Readme

Keywords

none

Package Sidebar

Install

npm i write-response

Weekly Downloads

0

Version

2.0.2

License

MIT

Unpacked Size

6.32 kB

Total Files

8

Last publish

Collaborators

  • markwylde