heapwolf / lev

The complete REPL & CLI for managing LevelDB instances.
MIT License
296 stars 36 forks source link

Option to pretty-print json? #31

Closed KyleAMathews closed 10 years ago

KyleAMathews commented 10 years ago

I mostly use leveldb to store json. It'd be nice if the REPL could detect the value is json and pretty-print it.

heapwolf commented 10 years ago

+1 that would be nice, but you need to detect what the encoding is, or something else creative ;)

KyleAMathews commented 10 years ago

It's not hard to test if a string is json like:

try {
    JSON.parse(x);
} catch (e) {
    console.log("not JSON");
}

But making pretty-print an explicit option would be fine.

heapwolf commented 10 years ago

this is now available the tui branch. will merge into master soon

heapwolf commented 10 years ago

also, tab completion is now colorized which makes the data much more readable.