Comparing version 1.0.3 to 1.0.4
{ | ||
"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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
No tests
QualityPackage does not have any tests. This is a strong signal of a poorly maintained or low quality package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Deprecated
MaintenanceThe maintainer of the package marked it as deprecated. This could indicate that a single version should not be used, or that the package is no longer maintained and any new vulnerabilities will not be fixed.
Found 1 instance in 1 package
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
No bug tracker
MaintenancePackage does not have a linked bug tracker in package.json.
Found 1 instance in 1 package
No website
QualityPackage does not have a website.
Found 1 instance in 1 package
0
0
67
0
7669
5
155