Socket
Socket
Sign inDemoInstall

@robcresswell/fastify-reply-ext

Package Overview
Dependencies
1
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @robcresswell/fastify-reply-ext

A really basic plugin for Fastify that adds reply helpers for all the status codes. This has a few uses;


Version published
Maintainers
1
Created

Readme

Source

fastify-reply-ext

A really basic plugin for Fastify that adds reply helpers for all the status codes. This has a few uses;

  • Remembering / autocompleting names of the HTTP responses is easier than remembering the numbers
  • Make your error responses consistently shaped

For example,

reply.badRequest();

is the same as

reply.code(400).send({ statusCode: 400, message: 'Bad Request' });

Getting started

import { fastify } from 'Fastify';
import { replyExtPlugin } from '@robcresswell/fastify-reply-ext';

const server = fastify();
await server.register(replyExtPlugin);

See Fastify's plugin docs for more information

FAQs

Last updated on 17 Mar 2021

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc