1.0.9 • Published 3 years ago

@ricktechs/nestjs-puppeteer v1.0.9

Weekly downloads
-
License
MIT
Repository
-
Last release
3 years ago

About

Nestjs module for generating pdf from handlebars templates

Usage

To import the Puppeteer module:

import { PuppeteerModule } from "@ricktechs/nestjs-puppeteer";

@Module({
  imports: [
    PuppeteerModule.forRoot({
      path: path.join(process.cwd(), "src/pdf/templates"), //path to handlebars templates
      outDir: "temp",
    }),
  ],
  providers: [PdfService],
})
export class PdfModule {}

To use the Puppeteer service:

import { PuppeteerService } from "@ricktechs/nestjs-puppeteer";

@Injectable()
export class PdfService {
  constructor(private readonly puppeteerService: PuppeteerService) {}

  async generate(input: PDFInput) {
    return await this.puppeteerService.toPDFStream(input);
  }
  async generateFromUrl(input: UrlToPDFInput) {
    return await this.puppeteerService.urlToPDFStream(input);
  }
}

Change Log

See Changelog for more information.

Contributing

Contributions welcome! See Contributing.

Author

Eric Wahome (Y Prospect on Discord)

License

Licensed under the MIT License - see the LICENSE file for details.

1.0.9

3 years ago

1.0.8

3 years ago

1.0.7

3 years ago

1.0.6

3 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago