1.0.0 • Published 3 years ago

ps2census-nestjs v1.0.0

Weekly downloads
3
License
Apache-2.0
Repository
github
Last release
3 years ago

PS2Census NestJS

CI npm version David DM Badge

About

Easy integration of the PS2 Census library for NestJS.

Installation

npm install ps2census ps2census-nestjs

Getting started

import {CensusModule} from 'ps2census-nestjs';

@Module({
  imports:[
    CensusModule.forRoot({
      serviceID: 'your DBG service id',
      // Any other Client options from ps2census
    }),
    // or
    CensusModule.forRootAsync({
      useFactory: () => ({
        serviceID: 'your DBG service id',
        // Any other Client options from ps2census
      }),
    }),
  ],
  providers: [CensusGateway],
})
import { Injectable } from '@nestjs/common';
import {Death} from 'ps2census';
import {CensusClient} from 'ps2census-nestjs';

@Injectable() // Controller decorator can also be used
export class CensusGateway {
  constructor(
    client: CensusClient,
  ) {}

  @On({event: 'death'})
  deathHandler(death: Death): void {
    // Do something
  }
}
1.0.0

3 years ago

0.2.1

3 years ago

0.2.0

3 years ago

0.1.2

4 years ago

0.1.1

4 years ago

0.1.0

4 years ago