@response/empty
v0.1.2
Published
A class representing an empty response.
Downloads
56
Readme
Empty Response
A class representing an empty response.
Installation
npm install @response/empty
Usage
const empty = require('@response/empty')
const http = require('http')
http.createServer((req, res) => {
// Status 204
empty().write(res)
// Status 200
empty(200).write(res)
// Status 200 & custom headers
empty(200, { 'X-Powered-By': 'Foobar' }).write(res)
})
Mutable Properties
statusCode: number
- The status codeheaders: object
- The custom headers