php-parser

This JavaScript library parses PHP code and converts it to an AST.

## Installation This library is distributed with [npm](https://www.npmjs.com/package/php-parser) : ```sh npm install php-parser --save ``` ## Usage ```js // initialize the php parser factory class const fs = require("fs"); const path = require("path"); const engine = require("php-parser"); // initialize a new parser instance const parser = new engine({ // some options : parser: { extractDoc: true, php7: true, }, ast: { withPositions: true, }, }); // Retrieve the AST from the specified source const eval = parser.parseEval('echo "Hello World";'); // Retrieve an array of tokens (same as php function token_get_all) const tokens = parser.tokenGetAll(' You can add here your own project by opening an issue request. ## License This library is released under BSD-3 license clause.