# nest-bugsnag

> A Nest module wrapper for bugsnag

Latest version **0.0.8** (published 2019-07-25) · MIT license · 0 weekly downloads

## Install

```sh
npm install nest-bugsnag
pnpm add nest-bugsnag
yarn add nest-bugsnag
bun add nest-bugsnag
```

## Health

**Score 20/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities.

Warnings: low downloads; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.8 |
| Published | 2019-07-25 |
| First published | 2019-04-30 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 7 |
| Unpacked size | 9.6 KB |
| Known vulnerabilities | 0 (+3 in 2 direct dependencies) |
| Install scripts | no |
| Author | Vitamojo Software |
| Maintainers | aistrati, nadejde, vitalikm |
| Keywords | nestjs, bugsnag, logger |

## Links

- npm: https://www.npmjs.com/package/nest-bugsnag
- Homepage: https://github.com/vita-mojo/nest-bugsnag
- Issues: https://github.com/vita-mojo/nest-bugsnag/issues
- npm.io page: https://npm.io/package/nest-bugsnag

## Dependencies (7)

- [rxjs](https://npm.io/package/rxjs.md) ^6.5.2
- [rimraf](https://npm.io/package/rimraf.md) ^2.6.3
- [@bugsnag/js](https://npm.io/package/@bugsnag/js.md) 5.2.0
- [@nestjs/core](https://npm.io/package/@nestjs/core.md) 6.5.3
- [@nestjs/common](https://npm.io/package/@nestjs/common.md) 6.5.3
- [reflect-metadata](https://npm.io/package/reflect-metadata.md) ^0.1.13
- [@nestjs/platform-express](https://npm.io/package/@nestjs/platform-express.md) 6.5.3

## Alternatives

- [cli-color](https://npm.io/package/cli-color.md) — 3.4M weekly downloads
- [log](https://npm.io/package/log.md) — 1.3M weekly downloads
- [logstash-client](https://npm.io/package/logstash-client.md) — 4.5K weekly downloads
- [@nocobase/plugin-logger](https://npm.io/package/@nocobase/plugin-logger.md) — 2.0K weekly downloads
- [child-process-debug](https://npm.io/package/child-process-debug.md) — 695 weekly downloads

## Recent versions

- 0.0.8 (latest) — 2019-07-25
- 0.0.6 — 2019-06-12
- 0.0.5 — 2019-04-30
- 0.0.4 — 2019-04-30
- 0.0.3 — 2019-04-30
- 0.0.2 — 2019-04-30
- 0.0.1 — 2019-04-30

## README

<p align="center">
  <a href="http://nestjs.com/" target="blank"><img src="https://nestjs.com/img/logo_text.svg" width="320" alt="Nest Logo" /></a>
</p>

 <p align="center">A Nest module wrapper for bugsnag logger.</p>
 
<p align="center">
<a href="https://github.com/vita-mojo/nest-bugsnag"><img src="https://img.shields.io/npm/v/nest-bugsnag.svg" alt="NPM Version" /></a>
<a href="https://github.com/vita-mojo/nest-bugsnag"><img src="https://img.shields.io/npm/l/nest-bugsnag.svg" alt="Package License" /></a>
<a href="https://github.com/vita-mojo/nest-bugsnag"><img src="https://img.shields.io/npm/dm/nest-bugsnag.svg" alt="NPM Downloads" /></a>
</p>

## Description

A [Nest](https://github.com/nestjs/nest) module wrapper for [bugsnag-js](https://github.com/bugsnag/bugsnag-js) logger.

## Installation

```bash
$ npm i nest-bugsnag --save
```

## Quick Start

Import the `BugsnagModule` into the module. For example `AppModule`:

```typescript
import { Module } from '@nestjs/common';
import { BugsnagModule } from 'nest-bugsnag';

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

Then you can inject BugsnagService. Example:

```typescript
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:

```typescript
this.logger.instance.notify('message');
```

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

## Async configuration Sample

```typescript
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

---
_Source: https://npm.io/package/nest-bugsnag · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
