GithubHelp home page GithubHelp logo

efd1006 / nestjs-enlighten Goto Github PK

View Code? Open in Web Editor NEW

This project forked from onur-ozkan/nestjs-enlighten

0.0 1.0 0.0 206 KB

Beta: A laravel-ignition like error page for NestJS Framework

License: MIT License

TypeScript 71.39% HTML 28.61%

nestjs-enlighten's Introduction

NestJS Enlighten

Test and Build Automated NPM Pusher Package Version License

A laravel-ignition like error page for Nestjs Framework

About

Nest Enlighten is a module for Nest Framework. With this module, you can render friendly error pages for spesific or global endpoints that includes a lot of detailed values behind the hood. Not only that, you can share your all or spesific stack tabs to your team online. By that, you or your team can monitor your error situation much better and easier.

Preview

Default(Light) Theme

Dark Theme

Installation

Install this package by running one of these following commands below

Via npm:
npm install nestjs-enlighten --save
Via yarn:
yarn add nestjs-enlighten

Usage

Constructor Options

Option Name Required Type Default
disableEnlighten false boolean false
theme false 'theme-light' - 'theme-dark' 'theme-light'

As Global Filter

import { NestEnlighten } from 'nestjs-enlighten';

async function bootstrap() {
  const app = await NestFactory.create(ApplicationModule);
  // Enables dark theme aswell
  app.useGlobalFilters(new NestEnlighten({ theme: 'theme-dark' }));
  await app.listen(3000);
}
bootstrap();

Enable/Disable for spesific endpoints

import { NestEnlighten } from 'nestjs-enlighten';

@Controller('account')
// Lets say you want to disable this module for this endpoint
@UseFilters(new NestEnlighten({ disableEnlighten: true }))
export class AccountController {

@Get('/error-test')
  throwError() {
    throw new Error('This is an error.');
  }
}

TODO

  • Tests
  • Github Actions
  • Online Stack share feature
  • Add solution suggestions on unexpected errors in /src/Services/Errors/State/index.ts

nestjs-enlighten's People

Contributors

onur-ozkan avatar dependabot[bot] avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.