Socket
Book a DemoInstallSign in
Socket

nest-bugsnag-remade

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

nest-bugsnag-remade

A Nest module wrapper for bugsnag - forked from nest-bugsnag

0.0.3
latest
npmnpm
Version published
Weekly downloads
3
Maintainers
1
Weekly downloads
 
Created
Source

Nest Logo

A Nest module wrapper for bugsnag logger.

NPM Version Package License NPM Downloads

Description

A Nest module wrapper for bugsnag-js logger.

Installation

$ yarn add nest-bugsnag-remade
# case you prefer to use npm
$ npm i nest-bugsnag-remade --save

Quick Start

Import the BugsnagModule into the module. For example AppModule:

import { Module } from "@nestjs/common";
import { BugsnagModule } from "nest-bugsnag-remade";

@Module({
  imports: [
    BugsnagModule.forRoot({
      // options
    }),
  ],
})
export class AppModule {}

Then you can inject BugsnagService. Example:

import { Controller } from "@nestjs/common";
import { BugsnagService } from "nest-bugsnag";

@Controller("cats")
export class CatsController {
  constructor(private readonly logger: BugsnagService) {}
}

BugsnagService has instance property which wrap bugsnag client. So you can access it by calling:

this.logger.instance.notify("message");

Note that BugsnagModule is a global module, it will be available in all you feature modules.

Async configuration Sample

import { Module } from "@nestjs/common";
import { BugsnagModule } from "nest-bugsnag";
import { ConfigService } from "nest-config";

@Module({
  imports: [
    BugsnagModule.forRootAsync({
      useFactory: (configService: ConfigService) => ({
        // options
      }),
      inject: [ConfigService],
    }),
  ],
})
export class AppModule {}

The factory might be async and is able to inject dependencies through the inject option.

Keywords

bugsnagJs, nestJs, logger

Keywords

nestjs

FAQs

Package last updated on 26 Mar 2021

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

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.