New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@zishone/jsend-mw

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@zishone/jsend-mw

A middleware to add jsend helper functions to the response object

  • 0.1.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

jsend-mw NPM Build Coverage License

A middleware to add jsend helper functions to the response object.

Installation

$ npm i @zishone/jsend-mw

Usage

const express = require('express');
const { jsend } = require('@zishone/jsend-mw');

const app = express();

app.use(jsend());

app.get('/success', (req, res) => {
  res.jsend.success({ /* any data */ }/*, 2XX*/);
});

app.get('/fail', (req, res) => {
  res.jsend.fail({ /* any data */ }/*, 4XX*/);
});

app.get('/error', (req, res) => {
  res.jsend.fail('An error message'/*, 5XX, errorCodeNumber, { any data }*/);
});

app.listen(port, () => {
  console.log('Listening at port 3000')
})

Authors

  • Zishran Garces

See also the list of contributors who participated in this project.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Keywords

FAQs

Package last updated on 31 Dec 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

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