unify-fastify
TypeScript icon, indicating that this package has built-in type declarations

1.5.47 • Public • Published

Test Coverage Maintainability npm npm Snyk Vulnerabilities for npm package NPM

Unify Fastify

A Fastify plugin wrapping unify-errors to handle REST errors. Old Owner: @flexper

Install

npm i unify-fastify
# Or
yarn add unify-fastify
# Or
pnpm add unify-fastify

Use

import fastify from 'fastify'
import unifyFastifyPlugin from 'unify-fastify';
import { BadRequest } from 'unify-errors';

const server = fastify()
server.register(unifyFastifyPlugin, { /* options */ })

server.get('/bad-request', async () => {
  throw new BadRequest({ example: 'A bad request error'})
})

Plugin options

name default description
disableDetails false Disable error details like stack
disableLog false Disable logging on error

Tests

To execute jest tests (all errors, type integrity test)

pnpm test

Maintain

This package use TSdx. Please check documentation to update this package.

Readme

Keywords

none

Package Sidebar

Install

npm i unify-fastify

Weekly Downloads

2,556

Version

1.5.47

License

MIT

Unpacked Size

72.3 kB

Total Files

12

Last publish

Collaborators

  • qlaffont