2017 © Pedro Peláez
 

library peast

Peast is PHP library that generates AST for JavaScript code

image

mck89/peast

Peast is PHP library that generates AST for JavaScript code

  • Monday, June 4, 2018
  • by mck89
  • Repository
  • 3 Watchers
  • 12 Stars
  • 1,807 Installations
  • PHP
  • 2 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 18 Versions
  • 300 % Grown

The README.md

Peast

Latest Stable Version Total Downloads License Build Status, (*1)

Peast (PHP ECMAScript Abstract Syntax Tree) is a PHP 5.4+ library that parses JavaScript code, according to ECMAScript specification, and generates an abstract syntax tree following the ESTree standard., (*2)

Installation

Include the following requirement to your composer.json:, (*3)

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

Run composer install to install the package., (*4)

Then in your script include the autoloader and you can start using Peast:, (*5)

require_once "vendor/autoload.php";

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

Known issues

When Xdebug is enabled and Peast is used to scan code that contains deeply nested functions, this fatal error can appear:, (*6)

PHP Fatal error:  Maximum function nesting level of '512' reached, aborting!

or, (*7)

PHP Warning:  Uncaught Error: Xdebug has detected a possible infinite loop, and aborted your script with a stack depth of '256' frames

To prevent this you can set xdebug.max_nesting_level to a higher value, such as 512., (*8)

Documentation

Read the documentation for more examples and explanations:, (*9)

  1. AST generation and tokenization
  2. Tree Traversing
  3. Querying By Selector
  4. Rendering

Changelog, (*10)

The Versions

04/06 2018

dev-master

9999999-dev

Peast is PHP library that generates AST for JavaScript code

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

The Development Requires

by Marco Marchiò

04/06 2018

v1.8

1.8.0.0

Peast is PHP library that generates AST for JavaScript code

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

The Development Requires

by Marco Marchiò

02/03 2018

1.7.x-dev

1.7.9999999.9999999-dev

Peast is PHP library that generates AST for JavaScript code

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

The Development Requires

by Marco Marchiò

25/02 2018

v1.7

1.7.0.0

Peast is PHP library that generates AST for JavaScript code

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

The Development Requires

by Marco Marchiò

08/01 2018

v1.6

1.6.0.0

Peast is PHP library that generates AST for JavaScript code

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

The Development Requires

by Marco Marchiò

08/01 2018

1.6.x-dev

1.6.9999999.9999999-dev

Peast is PHP library that generates AST for JavaScript code

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

The Development Requires

by Marco Marchiò

23/09 2017

1.5.x-dev

1.5.9999999.9999999-dev

Peast is PHP library that generates AST for JavaScript code

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

The Development Requires

by Marco Marchiò

23/09 2017

v1.5

1.5.0.0

Peast is PHP library that generates AST for JavaScript code

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

The Development Requires

by Marco Marchiò

23/06 2017

1.4.x-dev

1.4.9999999.9999999-dev

Peast is PHP library that generates AST for JavaScript code

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

The Development Requires

by Marco Marchiò

07/03 2017

v1.4

1.4.0.0

Peast is PHP library that generates AST for JavaScript code

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

by Marco Marchiò

14/02 2017

1.3.x-dev

1.3.9999999.9999999-dev

Peast is PHP library that generates AST for JavaScript code

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

by Marco Marchiò

14/02 2017

v1.3

1.3.0.0

Peast is PHP library that generates AST for JavaScript code

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

by Marco Marchiò

26/12 2016

1.2.x-dev

1.2.9999999.9999999-dev

Peast is PHP library that generates AST for JavaScript code

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

by Marco Marchiò

26/12 2016

v1.2

1.2.0.0

Peast is PHP library that generates AST for JavaScript code

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

by Marco Marchiò

29/10 2016

1.1.x-dev

1.1.9999999.9999999-dev

Peast is PHP library that generates AST for JavaScript code

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

by Marco Marchiò

29/10 2016

v1.1

1.1.0.0

Peast is PHP library that generates AST for JavaScript code

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

by Marco Marchiò

11/09 2016

1.0.x-dev

1.0.9999999.9999999-dev

Peast is PHP library that generates AST for JavaScript code

  Sources   Download

by Marco Marchiò

11/09 2016

v1.0

1.0.0.0

Peast is PHP library that generates AST for JavaScript code

  Sources   Download

by Marco Marchiò