Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@appjumpstart/mercury-send

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@appjumpstart/mercury-send

An Express/Connect-compatible middleware for sending HTTP responses

  • 1.0.0
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

mercury-send

An Express/Connect-compatible middleware for sending HTTP responses

npm page appjumpstart chat

About

mercury-send is a super simple middleware that provides (or overrides) a res.send function that you can use in other middleware/route handlers. You can use it with Node's http.Server, Express, or any connect-compatible framework. To get the most benefit, you'll want to use it in tandem with mercury-schema which will provide mercury-send with a stringify function based on a pre-compiled response schema.

Installation

❯ npm install @appjumpstart/mercury-send --save

Usage

const mercurySend = require('@appjumpstart/mercury-send')

// ...

// Use the mercury-send middleware to more easily send responses.
app.use(mercurySend)

// Use res.send in your route-handler to send object that are converted to
// JSON using JSON.stringify or perhaps a stringify function provided by
// mercury-schema.
app.get('/', (req, res) => res.type('json').send({ message: 'Hello!' }))

Acknowledgement

mercury-send is completely modeled around some of the features within the excellent Fastify framework.

 

AppJumpstart

Keywords

FAQs

Package last updated on 23 May 2018

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc