var_dump

1.0.6 • Public • Published

var_dump

Implementation of PHP's var_dump function for JavaScript.

JavaScript Style Guide

Version npm NPM Downloads License GitHub Repository Size JavaScript Style Guide

NPM

Installation

Either through cloning with git or by using npm (the recommended way):

npm install var_dump --save-dev

Usage

const var_dump = require('var_dump')

Use var_dump while development for printing details of variables and functions.

var variable = {
  'data': {
    'users': {
      'id': 12,
      'friends': [{
        'id': 1,
        'name': 'John Doe'
      }]
    }
  }
}

// print the variable using var_dump
var_dump(variable)

This will print:

object(1) {
    ["data"] => object(1) {
        ["users"] => object(2) {
            ["id"] => number(12)
            ["friends"] => array(1) {
                [0] => object(2) {
                    ["id"] => number(1)
                    ["name"] => string(8) "John Doe"
                }
            }
        }
    }
}

Dependents (0)

Package Sidebar

Install

npm i var_dump

Weekly Downloads

216

Version

1.0.6

License

MIT

Unpacked Size

10.2 kB

Total Files

7

Last publish

Collaborators

  • ankurnarkhede