1- # php-parser-ts
1+ # @ rightcapital/ php-parser — A Pure TypeScript Port of nikic/PHP-Parser
22
33<!-- Badges area start -->
44
@@ -67,15 +67,15 @@ This project is a faithful port of nikic/PHP-Parser v5 from PHP to TypeScript. I
6767## Installation
6868
6969``` bash
70- npm install php-parser-ts
70+ npm install @rightcapital/ php-parser
7171```
7272
7373## Usage
7474
7575### Parsing PHP Code
7676
7777``` typescript
78- import { ParserFactory } from ' php-parser-ts ' ;
78+ import { ParserFactory } from ' @rightcapital/ php-parser' ;
7979
8080const factory = new ParserFactory ();
8181const parser = factory .createForNewestSupportedVersion ();
@@ -85,7 +85,7 @@ const ast = parser.parse('<?php echo "Hello, World!";');
8585### Dumping the AST
8686
8787``` typescript
88- import { NodeDumper } from ' php-parser-ts ' ;
88+ import { NodeDumper } from ' @rightcapital/ php-parser' ;
8989
9090const dumper = new NodeDumper ();
9191console .log (dumper .dump (ast ));
@@ -94,7 +94,7 @@ console.log(dumper.dump(ast));
9494### Pretty Printing
9595
9696``` typescript
97- import { StandardPrettyPrinter } from ' php-parser-ts ' ;
97+ import { StandardPrettyPrinter } from ' @rightcapital/ php-parser' ;
9898
9999const printer = new StandardPrettyPrinter ();
100100console .log (printer .prettyPrintFile (ast ));
@@ -103,7 +103,7 @@ console.log(printer.prettyPrintFile(ast));
103103### Traversing and Transforming
104104
105105``` typescript
106- import { NodeTraverser , NodeVisitor } from ' php-parser-ts ' ;
106+ import { NodeTraverser , NodeVisitor } from ' @rightcapital/ php-parser' ;
107107
108108class MyVisitor extends NodeVisitor {
109109 enterNode(node ) {
@@ -119,7 +119,7 @@ const modified = traverser.traverse(ast);
119119### Building AST Nodes
120120
121121``` typescript
122- import { BuilderFactory } from ' php-parser-ts ' ;
122+ import { BuilderFactory } from ' @rightcapital/ php-parser' ;
123123
124124const factory = new BuilderFactory ();
125125const classNode = factory .class_ (' MyClass' )
@@ -206,4 +206,4 @@ npm run build
206206
207207## License
208208
209- BSD-3-Clause (same as nikic/PHP-Parser)
209+ MIT
0 commit comments