@smartankur4u/vardumpdeprecated

Implementation of PHP's var_dump function for JavaScript.

Usage no npm install needed!

<script type="module">
  import smartankur4uVardump from 'https://cdn.skypack.dev/@smartankur4u/vardump';
</script>

README

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"
                    }
                }
            }
        }
    }
}