PHPackages                             nelson/puppeteer - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. nelson/puppeteer

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

nelson/puppeteer
================

5.0.5(1y ago)076[2 PRs](https://github.com/Gappa/Puppeteer/pulls)PHPPHP ^8.3.0CI failing

Since Jul 9Pushed 5mo agoCompare

[ Source](https://github.com/Gappa/Puppeteer)[ Packagist](https://packagist.org/packages/nelson/puppeteer)[ RSS](/packages/nelson-puppeteer/feed)WikiDiscussions master Synced 2mo ago

READMEChangelog (10)Dependencies (9)Versions (23)Used By (0)

Puppeteer
=========

[](#puppeteer)

Install
-------

[](#install)

1. `composer require nelson/puppeteer`.
2. Navigate to `%vendorDir%/nelson/puppeteer` and run `npm install` - be sure to do this on the target machine!

Configuration
-------------

[](#configuration)

1. Enable the extension:

    ```
    extensions:
    	puppeteer: Nelson\Puppeteer\DI\Extension
    ```
2. Configuration:

    ```
    puppeteer:
    	tempDir: '%tempDir%/puppeteer/'
    	timeout: 120 # seconds
    	sandbox: null # or path to the chrome-devel-sandbox binary
    	nodeCommand: 'node' # in case multiple versions are installed
    ```

    These are the default values.

Sandbox
-------

[](#sandbox)

Using sandbox is highly encouraged (by Puppeteer team).

-

Usage
-----

[](#usage)

Most basic usage:

```
$html = 'Puppeteer testSome text paragraph';
$html .= '' . date(DateTime::ISO8601) . '';
$html .= '';

/** @var Generator $generator */
$generator = $this->generatorFactory->create();
$output = $generator->generateFromHtml($html, Generator::GENERATE_BOTH);
```

Note: The HTML is not directly passed to the node process. Instead, it is first saved to a temp file and then read by node. This is done intentionally for the generator to deal with large HTML payloads. `nesk/puphpeteer` suffers from this problem, as the data is sent via JSON (AFAIK) and crashes on large HTML, otherwise it works just fine and is a great tool.

There are currently three output modes:

- `Generator::GENERATE_PDF`
- `Generator::GENERATE_IMAGE`
- `Generator::GENERATE_BOTH`

These are self-explanatory.

The generator also supports generating from URL:

```
$output = $generator->generateFromUrl(new UrlScript('https://www.google.com'), Generator::GENERATE_BOTH);
```

Variable `$output` contains:

```
array(4) {
  ["pdf"]=>
  string(150) "/xyz/puppeteer/app/../temp/puppeteer/1562653154_-_58f8da81a3c0c3399838891fe88d0db7.pdf"
  ["image"]=>
  string(150) "/xyz/puppeteer/app/../temp/puppeteer/1562653154_-_58f8da81a3c0c3399838891fe88d0db7.png"
  ["command"]=>
  array(7) {
    [0]=>
    string(4) "node"
    [1]=>
    string(91) "/xyz/puppeteer/src/assets/generator.js"
    [2]=>
    string(16) "--inputMode=file"
    [3]=>
    string(159) "--input=/xyz/puppeteer/app/../temp/puppeteer/1562653154_-_58f8da81a3c0c3399838891fe88d0db7.html"
    [4]=>
    string(5) "--pdf"
    [5]=>
    string(7) "--image"
    [6]=>
    string(155) "--output=/xyz/puppeteer/app/../temp/puppeteer/1562653154_-_58f8da81a3c0c3399838891fe88d0db7"
  }
  ["console"]=>
  string(0) ""
}
```

Legend:

- `pdf`/`image` are dependant on the mode used.
- `command` - raw command passed from PHP to NODE.js via Symfony/Process.
- `console` - raw output from NODE (via `console.log`). Should be empty in most cases.

###  Health Score

42

—

FairBetter than 90% of packages

Maintenance53

Moderate activity, may be stable

Popularity9

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity83

Battle-tested with a long release history

 Bus Factor1

Top contributor holds 86.3% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~94 days

Recently: every ~8 days

Total

20

Last Release

704d ago

Major Versions

1.x-dev → 2.0.02020-02-07

2.0.2 → 3.0.02022-10-25

3.0.1 → 4.0.02024-01-31

4.0.1 → 5.0.02024-05-02

2.x-dev → 5.0.12024-05-02

PHP version history (5 changes)1.0.0PHP ^7.1

3.0.0PHP &gt;=8.0 &lt;8.2

4.0.0PHP ~8.2.0

4.0.1PHP ~8.2.0 || ~8.3.0

5.0.0PHP ^8.3.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/b4e805c40ec66ed697671aed10e809e3eff9f0a04688fffd7a5698d722dcff6a?d=identicon)[Gappa](/maintainers/Gappa)

---

Top Contributors

[![Gappa](https://avatars.githubusercontent.com/u/749981?v=4)](https://github.com/Gappa "Gappa (44 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (7 commits)")

###  Code Quality

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/nelson-puppeteer/health.svg)

```
[![Health](https://phpackages.com/badges/nelson-puppeteer/health.svg)](https://phpackages.com/packages/nelson-puppeteer)
```

###  Alternatives

[symplify/monorepo-builder

Not only Composer tools to build a Monorepo.

5205.3M82](/packages/symplify-monorepo-builder)[contributte/menu-control

Menu control for Nette framework

29108.6k1](/packages/contributte-menu-control)[carrooi/nette-menu

Menu control for Nette framework

2950.0k1](/packages/carrooi-nette-menu)[ipub/gravatar

Gravatar creator for Nette Framework

122.0k1](/packages/ipub-gravatar)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
