{"id":21569435,"url":"https://github.com/naturalcycles/puppeteer-lib","last_synced_at":"2025-03-18T05:45:16.616Z","repository":{"id":34727926,"uuid":"183058421","full_name":"NaturalCycles/puppeteer-lib","owner":"NaturalCycles","description":"CLI to quickly produce PDFs from HTML files using Puppeteer","archived":false,"fork":false,"pushed_at":"2022-12-03T06:54:13.000Z","size":1115,"stargazers_count":1,"open_issues_count":12,"forks_count":0,"subscribers_count":12,"default_branch":"master","last_synced_at":"2025-03-09T09:41:23.375Z","etag":null,"topics":["cli","html","pdf","puppeteer"],"latest_commit_sha":null,"homepage":null,"language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/NaturalCycles.png","metadata":{"files":{"readme":"readme.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-04-23T16:51:57.000Z","updated_at":"2020-05-10T17:53:02.000Z","dependencies_parsed_at":"2023-01-15T09:00:37.805Z","dependency_job_id":null,"html_url":"https://github.com/NaturalCycles/puppeteer-lib","commit_stats":null,"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NaturalCycles%2Fpuppeteer-lib","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NaturalCycles%2Fpuppeteer-lib/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NaturalCycles%2Fpuppeteer-lib/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NaturalCycles%2Fpuppeteer-lib/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/NaturalCycles","download_url":"https://codeload.github.com/NaturalCycles/puppeteer-lib/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244166677,"owners_count":20409178,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cli","html","pdf","puppeteer"],"created_at":"2024-11-24T11:09:29.831Z","updated_at":"2025-03-18T05:45:16.576Z","avatar_url":"https://github.com/NaturalCycles.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"## @naturalcycles/puppeteer-lib\n\n\u003e CLI to quickly produce PDFs or screenshots from HTML files or urls using Puppeteer\n\n[![npm](https://img.shields.io/npm/v/@naturalcycles/puppeteer-lib/latest.svg)](https://www.npmjs.com/package/@naturalcycles/puppeteer-lib)\n[![](https://circleci.com/gh/NaturalCycles/puppeteer-lib.svg?style=shield\u0026circle-token=123)](https://circleci.com/gh/NaturalCycles/puppeteer-lib)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square)](https://github.com/prettier/prettier)\n\n# Install\n\n    yarn add @naturalcycles/puppeteer-lib\n\nOR\n\n    npm i @naturalcycles/puppeteer-lib\n\n# Features\n\n- `yarn html2pdf`\n- `yarn html2png`\n- `yarn url2pdf`\n- `yarn url2png`\n\n# html2pdf\n\n    yarn html2pdf index.html\n\nWill produce `index.html.pdf` file next to the original file.\n\nPositional arguments:\n\n- List of paths to process. Multiple files are supported. Globs are supported (see examples below).\n\nOptions:\n\nRun `yarn html2pdf help` to see all available options.\n\n- `--scale` Print scale, e.g `0.5`. Default: `1`.\n- `--format`. Default: `A4`. Google which PDF formats Puppeteer supports.\n- `--landscape`. Default: `false`.\n- `--margins`, e.g `20mm 20mm 20mm 20mm` (css-like syntax).\n- `--headerTemplate`, `--footerTemplate`\n- `--headerTemplateFile`, `--footerTemplateFile`\n- `--headerText`, `--footerText`\n- `--headerTextFile`, `--footerTextFile`\n- `--concurrency` Concurrency for opened Puppeteer pages. Default to 8. Tune if something is not\n  working.\n- `--verbose` Print more logs.\n- `--debug`\n\nExample, convert many matching files:\n\n    yarn html2pdf index1.html index2.html\n\nExample, convert all matching files:\n\n    yarn html2pdf './someFolder/**/*.html'\n\n# html2png\n\n    yarn html2pdf index.html\n\nWill produce `index.html.png` file next to the original file.\n\nPositional arguments:\n\n- List of paths to process. Multiple files are supported. Globs are supported (see examples below).\n\nOptions:\n\nRun `yarn html2png help` to see all available options.\n\n- `--verbose` Print more logs.\n- `--concurrency` Concurrency for opened Puppeteer pages. Default to 8. Tune if something is not\n  working.\n- `--format`. Default: `png`. `jpeg` is also supported.\n  - `--quality` `0-100`, only for `jpeg`\n- `--wh` (Width/Height). Default: `800x600`. String, width/height separated by `x` character.\n- `--fullpage`\n\nExample, convert many matching files:\n\n    yarn html2pdf index1.html index2.html\n\nExample, convert all matching files:\n\n    yarn html2pdf './someFolder/**/*.html'\n\n# url2pdf\n\n    yarn url2pdf https://google.com --outDir someDir\n\nWill produce `someDir/1.pdf` file. Files are numbered incrementally starting with 1 based on order\nof inputs.\n\nOptions: same as html2pdf, plus:\n\n- `--outDir` - output directory (defaults to `cwd`)\n\n# url2png\n\n    yarn url2png https://google.com --outDir someDir\n\nWill produce `someDir/1.png` file. Files are numbered incrementally starting with 1 based on order\nof inputs.\n\nOptions: same as html2png, plus:\n\n- `--outDir` - output directory (defaults to `cwd`)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnaturalcycles%2Fpuppeteer-lib","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnaturalcycles%2Fpuppeteer-lib","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnaturalcycles%2Fpuppeteer-lib/lists"}