Latest Threat Research:Malicious dYdX Packages Published to npm and PyPI After Maintainer Compromise.Details
Socket
Book a DemoInstallSign in
Socket

pdp

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pdp

Node.js parser of PHP var dumps

latest
Source
npmnpm
Version
0.1.3
Version published
Weekly downloads
4
33.33%
Maintainers
1
Weekly downloads
 
Created
Source

pdp === PHP Dump Parser

Node.js parser of PHP var dumps.

build
status

Install

npm install pdp

Usage (or what is a PHP dump?)

Given a variable, the PHP function print_r will print human-readable information about the variable. This is best illustrated with an example:

<pre>
<?php
$a = array ('a' => 'apple', 'b' => 'banana', 'c' => array ('x', 'y', 'z'));
print_r ($a);
?>
</pre>

The above example will output:

<pre>
Array
(
    [a] => apple
    [b] => banana
    [c] => Array
        (
            [0] => x
            [1] => y
            [2] => z
        )
)
</pre>

Feed the above output inside the <pre> tags to this module and you get a nice JavaScript object literal or Array:

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

Keywords

php

FAQs

Package last updated on 06 Jan 2014

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts