PHPackages                             automit2021/peast - 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. [Parsing &amp; Serialization](/categories/parsing)
4. /
5. automit2021/peast

ActiveLibrary[Parsing &amp; Serialization](/categories/parsing)

automit2021/peast
=================

Peast is PHP library that generates AST for JavaScript code

v2.0.0(3y ago)0151BSD-3-ClausePHPPHP &gt;=8.1.0

Since Sep 11Pushed 3y agoCompare

[ Source](https://github.com/automit2021/peast)[ Packagist](https://packagist.org/packages/automit2021/peast)[ RSS](/packages/automit2021-peast/feed)WikiDiscussions master Synced 3d ago

READMEChangelog (2)Dependencies (1)Versions (49)Used By (0)

Peast
=====

[](#peast)

[![Latest Stable Version](https://camo.githubusercontent.com/01dc14dda7553d254bb5740be57bc53fbc55fad957d4d1bffb3fc620b27c7cf4/68747470733a2f2f706f7365722e707567782e6f72672f6d636b38392f70656173742f762f737461626c65)](https://packagist.org/packages/mck89/peast)[![Total Downloads](https://camo.githubusercontent.com/ebcfc86965e1aa084159376b3d9cdd4cabdbe30b27837aaff08d0e47082a5ad4/68747470733a2f2f706f7365722e707567782e6f72672f6d636b38392f70656173742f646f776e6c6f616473)](https://packagist.org/packages/mck89/peast)[![License](https://camo.githubusercontent.com/de9e95bd9338cfda81c20aa0b8722029a176fd5d31f15fca60a5e0def533150c/68747470733a2f2f706f7365722e707567782e6f72672f6d636b38392f70656173742f6c6963656e7365)](https://packagist.org/packages/mck89/peast)[![Codacy Badge](https://camo.githubusercontent.com/d0d168cb02cc9e54d8180deab8cc311fea305debf424e0a6225e1b9e97767bff/68747470733a2f2f6170692e636f646163792e636f6d2f70726f6a6563742f62616467652f47726164652f3364313839306666393339343438393038333366663062356431376435306436)](https://www.codacy.com/app/marcomarchi89/peast?utm_source=github.com&utm_medium=referral&utm_content=mck89/peast&utm_campaign=Badge_Grade)[![Codacy Badge](https://camo.githubusercontent.com/a7be85e01cb571e4e4e9ea8ab8552d48900b08671da3a43dbcb947b1f04098e8/68747470733a2f2f6170692e636f646163792e636f6d2f70726f6a6563742f62616467652f436f7665726167652f3364313839306666393339343438393038333366663062356431376435306436)](https://www.codacy.com/app/marcomarchi89/peast?utm_source=github.com&utm_medium=referral&utm_content=mck89/peast&utm_campaign=Badge_Coverage)[![Build Status](https://camo.githubusercontent.com/7a85675b9d33b782ffa3de43f2ad64bdefa4ae554cfe05cc31ecccc702a081ec/68747470733a2f2f7472617669732d63692e6f72672f6d636b38392f70656173742e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/mck89/peast)

**Peast** *(PHP ECMAScript Abstract Syntax Tree)* is a PHP 5.4+ library that parses JavaScript code, according to [ECMAScript specification](http://www.ecma-international.org/publications/standards/Ecma-262.htm), and generates an abstract syntax tree following the [ESTree standard](https://github.com/estree/estree).

Installation
------------

[](#installation)

Include the following requirement to your composer.json:

```
{
	"require": {
		"mck89/peast": "dev-master"
	}
}

```

Run `composer install` to install the package.

Then in your script include the autoloader and you can start using Peast:

```
require_once "vendor/autoload.php";

$source = "var a = 1"; //Your JavaScript code
$ast = Peast\Peast::latest($source, $options)->parse(); //Parse it!
```

Documentation
-------------

[](#documentation)

Read the documentation for more examples and explanations:

1. [AST generation and tokenization](doc/ast-and-tokenization.md)
2. [Tree Traversing](doc/tree-traversing.md)
3. [Querying By Selector](doc/querying-by-selector.md)
4. [Rendering](doc/rendering.md)

[Changelog](doc/changelog.md)

###  Health Score

35

—

LowBetter than 80% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity85

Battle-tested with a long release history

 Bus Factor1

Top contributor holds 98.1% 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 ~48 days

Recently: every ~87 days

Total

46

Last Release

1358d ago

Major Versions

v1.13.10 → v2.0.02022-08-23

PHP version history (2 changes)v1.1PHP &gt;=5.4.0

v2.0.0PHP &gt;=8.1.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/b086717a3f91192a67a4d5ddad6154ec01a7120cf606d7b5e385c4167e0146b7?d=identicon)[Alexey Sinkevich](/maintainers/Alexey%20Sinkevich)

---

Top Contributors

[![mck89](https://avatars.githubusercontent.com/u/466041?v=4)](https://github.com/mck89 "mck89 (605 commits)")[![jrfnl](https://avatars.githubusercontent.com/u/663378?v=4)](https://github.com/jrfnl "jrfnl (5 commits)")[![seka19](https://avatars.githubusercontent.com/u/2714877?v=4)](https://github.com/seka19 "seka19 (3 commits)")[![krizalys](https://avatars.githubusercontent.com/u/1499352?v=4)](https://github.com/krizalys "krizalys (1 commits)")[![exussum12](https://avatars.githubusercontent.com/u/1102850?v=4)](https://github.com/exussum12 "exussum12 (1 commits)")[![schlessera](https://avatars.githubusercontent.com/u/83631?v=4)](https://github.com/schlessera "schlessera (1 commits)")[![soullivaneuh](https://avatars.githubusercontent.com/u/1698357?v=4)](https://github.com/soullivaneuh "soullivaneuh (1 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/automit2021-peast/health.svg)

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

###  Alternatives

[mtdowling/jmespath.php

Declaratively specify how to extract elements from a JSON document

2.0k472.8M135](/packages/mtdowling-jmespathphp)[opis/closure

A library that can be used to serialize closures (anonymous functions) and arbitrary data.

2.6k230.0M284](/packages/opis-closure)[masterminds/html5

An HTML5 parser and serializer.

1.8k242.8M229](/packages/masterminds-html5)[sabberworm/php-css-parser

Parser for CSS Files written in PHP

1.8k191.2M65](/packages/sabberworm-php-css-parser)[michelf/php-markdown

PHP Markdown

3.5k52.4M345](/packages/michelf-php-markdown)[jms/metadata

Class/method/property metadata management in PHP

1.8k152.8M88](/packages/jms-metadata)

PHPackages © 2026

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