Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

var_dump

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

var_dump - npm Package Compare versions

Comparing version 1.0.3 to 1.0.4

.editorconfig

40

package.json
{
"name": "var_dump",
"version": "1.0.3",
"main": "var_dump",
"version": "1.0.4",
"description": "Implementation of PHP's var_dump function for JavaScript.",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
"type": "git",
"url": "https://github.com/hezedu/var_dump.js.git"
"url": "git+https://github.com/smartankur4u/var_dump.git"
},
"author": {
"name": "hezedu"
"keywords": [
"var_dump",
"vardump",
"var-dump",
"js_var_dump",
"var_dump_js",
"dump",
"variables",
"print",
"PHP",
"node",
"debugging",
"console",
"development"
],
"author": "Ankur Narkhede",
"license": "MIT",
"bugs": {
"url": "https://github.com/smartankur4u/var_dump/issues"
},
"licenses": "MIT",
"email": "hezedu@hotmail.com",
"description": "JS powfull dump!",
"bugs": {
"url": "https://github.com/hezedu/var_dump.js/issues"
}
"homepage": "https://github.com/smartankur4u/var_dump#readme"
}
# var_dump
javaScript var ' powerful dump,不会陷入死循环
##示例
```js
var test = {
a:'a',
b:'b'
}
test.c = test;
document.write(var_dump(test));
```
result:
Implementation of PHP's var_dump function for JavaScript.
![image](https://github.com/hezedu/SomethingBoring/blob/master/var_dump/test.jpg?raw=true)
[![JavaScript Style Guide](https://cdn.rawgit.com/standard/standard/master/badge.svg)](https://github.com/standard/standard)
![Version npm](https://img.shields.io/npm/v/var_dump.svg?style=for-the-badge)
![NPM Downloads](https://img.shields.io/npm/dt/var_dump.svg?style=for-the-badge)
![License](https://img.shields.io/npm/l/var_dump.svg?style=for-the-badge)
![GitHub Repository Size](https://img.shields.io/github/repo-size/smartankur4u/var_dump.svg?style=for-the-badge)
[![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg?style=for-the-badge)](https://standardjs.com)
##安装
nodejs
[![NPM](https://nodei.co/npm/var_dump.png?downloads=true&downloadRank=true)](https://nodei.co/npm/var_dump/)
`npm install var_dump`
###前端
## Installation
`<script src='../var_dump.js'></script>`
Either through cloning with git or by using [npm](http://npmjs.org) (the recommended way):
##使用
前端(browser)
```bash
npm install var_dump --save-dev
```
可以遍历 window 对象(除了IE);
## Usage
```js
document.write(var_dump( //变量 ));
const var_dump = require('var_dump')
```
后端(nodejs):
Use var_dump while development for printing details of variables and functions.
```js
var http = require('http');
var var_dump = require('var_dump.js');
http.createServer(function (req, res) {
res.writeHead(200, {'Content-Type': 'text/html'});
var_dump.init(res);//初始代,只需一次
res.write(var_dump(global));
res.end('Hello World\n');
}).listen(1337, '127.0.0.1');
console.log('Server running at http://127.0.0.1:1337/');
var variable = {
'data': {
'users': {
'id': 12,
'friends': [{
'id': 1,
'name': 'John Doe'
}]
}
}
}
// print the variable using var_dump
var_dump(variable)
```
<h2>demo:</h2>
http://godmod.cn/var_dump
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"
}
}
}
}
}
```

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc