@ricktechs/nestjs-puppeteer
TypeScript icon, indicating that this package has built-in type declarations

1.0.9 • Public • Published

NestJS puppeteer

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.


Readme

Keywords

none

Package Sidebar

Install

npm i @ricktechs/nestjs-puppeteer

Weekly Downloads

0

Version

1.0.9

License

MIT

Unpacked Size

242 kB

Total Files

37

Last publish

Collaborators

  • erichomes