Latest Threat ResearchGlassWorm Loader Hits Open VSX via Developer Account Compromise.Details
Socket
Book a DemoInstallSign in
Socket

http-responders

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

http-responders

Zero-dependency http responders

Source
npmnpm
Version
1.0.0
Version published
Weekly downloads
3
-50%
Maintainers
1
Weekly downloads
 
Created
Source

http-responders

Zero-dependency HTTP response functions.

Supports:

  • json
  • redirect
  • stream
  • file
  • download

Example

const { json } = require('http-responders')

http.createServer((req, res) => {
  json(res, { beep: 'boop' })
})

Installation

$ npm install http-responders

API

.json(res, json)

.redirect(req, res, location)

.stream(res, stream)

.file(res, path, [fsOpts])

.download(res, path, [fsOpts])

Kudos

Development of this module is sponsored by:

Liberate Science

License

MIT

FAQs

Package last updated on 28 Jan 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts