Skip to content
repr.js - a more useful representation of objects than default conversion to string
JavaScript Python
Find file
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
test
.gitignore
CHANGES.txt
LICENSE
README.md
TODO.txt
bower.json
dodo.py
hint.json
karma.conf.js
package.json
py_requirements.txt
repr.js

README.md

repr.js

A more descriptive represetation of values than Object.toString().

usage

repr(whatever);

> repr(null)
"<null>"

> repr(undefined)
"<undefined>"

> repr(3)
"3"

> repr("abc")
""abc""

> repr([1,2,3])
"[1, 2, 3]"

> repr({a:1, b:2})
"{"a":1, "b":2}"

> repr(function foo(){})
"<Function foo>"

> function Bar(){};
> Bar.prototype.hi = function(){};
> repr(Bar)
"<Constructor Bar>"

> repr(new Bar())
"<Bar {}>"

development setup

install python dependencies

$ pip install -r py_requirements.txt

install node and bower packages

$ doit dev_setup

running tests

On command line:

$ doit

On browser, open the file test/runner.html

Something went wrong with that request. Please try again.