# pdp **Repository Path**: mirrors_watson/pdp ## Basic Information - **Project Name**: pdp - **Description**: Node.js parser of PHP var dumps - **Primary Language**: Unknown - **License**: MIT - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2020-09-26 - **Last Updated**: 2026-03-29 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # pdp === PHP Dump Parser Node.js parser of PHP var dumps. [![build status](https://secure.travis-ci.org/watson/pdp.png)](http://travis-ci.org/watson/pdp) ## Install ``` npm install pdp ``` ## Usage (or what is a PHP dump?) Given a variable, the PHP function [print_r](http://www.php.net/print_r) will print human-readable information about the variable. This is best illustrated with an example: ```php
 'apple', 'b' => 'banana', 'c' => array ('x', 'y', 'z'));
print_r ($a);
?>
``` The above example will output: ```html
Array
(
    [a] => apple
    [b] => banana
    [c] => Array
        (
            [0] => x
            [1] => y
            [2] => z
        )
)
``` Feed the above output inside the `
` tags to this module and you get
a nice JavaScript object literal or Array:

```javascript
var pdp = require('pdp');
var dump = '...'; // let's imagine we have the entire Array(...) dump here
console.log(pdp(dump)); // prints: { a: 'apple', b: 'banana', c: [ 'x', 'y', 'z' ] }
```

## License

MIT