1.0.4 • Published 5 years ago

@smartankur4u/vardump v1.0.4

Weekly downloads
1
License
MIT
Repository
github
Last release
5 years ago

vardump

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 @smartankur4u/vardump --save-dev

Usage

const vardump = require('@smartankur4u/vardump')

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

var variable = {
  'data': {
    'stuff': [{
      'onetype': [{
        'id': 1,
        'name': 'John Doe'
      },
        {
          'id': 2,
          'name': 'Don Joeh'
        }
      ]
    }]
  }
}

// print the variable using vardump
vardump(variable)

This will print

object(1) {
    ["data"] => object(1) {
        ["stuff"] => array(1) {
            [0] => object(1) {
                ["onetype"] => array(2) {
                    [0] => object(2) {
                        ["id"] => number(1)
                        ["name"] => string(8) "John Doe"
                    }
                    [1] => object(2) {
                        ["id"] => number(2)
                        ["name"] => string(8) "Don Joeh"
                    }
                }
            }
        }
    }
}