Skip to content
This repository has been archived by the owner on Jan 31, 2022. It is now read-only.

PrimeVOX/zzz_archive_titere

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CLI and lib for Puppeteer

CLI

inline

$ node ./ inline <url|string>

You can pass any URL or a complete string of HTML to this command and the PDF will be returned as a Buffer

Only one argument is processed and any other arguments will be ignored.

store

$ node ./ store <batch> [filename|<url|string>]

Batch must be specified as a string. This makes cleanup easier.

Pass as many arguments as desired. Titere makes no assumptions as to filenames, so you must specify the filename followed by the URL or HTML string, the two parts separated by a pipe character.

clean

$ node ./ clean <batch> <?pattern>

Easily remove an entire batch of files by specifying the batch name. If you need more control over which files are removed and when, you can optionally pass a string pattern to apply to that batch directory, removing only the file names that match.

Library functions

The following functions are exported directly.

inline

/**
 * Generate single PDF from URL or HTML string, returning Buffer
 * for immediate display or usage.
 * 
 * @param  {string} urlOrHtml
 * @returns Promise<Buffer>
 */

store

/**
 * Generate PDF files, then stored locally in a batch directory
 * 
 * @param  {string} batch
 * @param  {IFile[]} files
 * @returns Promise<IFile[]>
 */

clean

/**
 * Remove previously generated PDF file(s) and batch directory
 * 
 * @param  {string} batch
 * @param  {string} pattern?
 * @returns Promise<boolean>
 */

About

Node CL script to manage PDF generation

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published