Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/nv/jsdump
Fork of jsDump by Ariel Flesler
https://github.com/nv/jsdump
Last synced: about 2 months ago
JSON representation
Fork of jsDump by Ariel Flesler
- Host: GitHub
- URL: https://github.com/nv/jsdump
- Owner: NV
- Created: 2010-02-18T13:02:05.000Z (almost 15 years ago)
- Default Branch: gh-pages
- Last Pushed: 2015-11-20T15:33:13.000Z (about 9 years ago)
- Last Synced: 2024-10-13T21:39:53.405Z (2 months ago)
- Language: JavaScript
- Homepage: http://nv.github.com/jsDump/
- Size: 192 KB
- Stars: 31
- Watchers: 5
- Forks: 6
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
jsDump
======`jsDump.parse(object)` returns a string containing a human-readable representation of `object`.
jsDump is like [Mozilla’s toSource()](https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Objects/Function/toSource),
but it works in all modern browsers.[jsDump](http://flesler.blogspot.com/2008/05/jsdump-pretty-dump-of-any-javascript.html)
was originally developed by Ariel Flesler.
This fork based on [version 1.0.0](http://code.google.com/p/flesler-projects/source/browse/trunk/javascript/JSDump/).Similar Stuff
-------- `JSON.stringify()`. Doesn’t serialize functions and DOM nodes.
- `inspect()` from [Node.js sys module](http://nodejs.org/api.html#_system_module)
- `repr()` from Narwhal’s util module
- `console._source_of()` from [Console.js](http://github.com/NV/console.js/)[NPM](http://search.npmjs.org/#/jsDump)
---npm install jsDump
Usage:
var jsDump = require("jsDump");
jsDump.parse({foo: 'bar', length: 0});[Tests](http://nv.github.com/jsDump/tests/)
-----
In the browser:1. `git submodule update --init`
2. open `tests/index.html`Or from command line:
$ narwhal tests/*_test.js
Contribution
------------
Use [jQuery coding style](http://docs.jquery.com/UI_Developer_Guide#Coding_Style).
Basically, use tabs instead of spaces.