mafintosh / hyperlog

Merkle DAG that replicates based on scuttlebutt logs and causal linking
MIT License
470 stars 33 forks source link

valueEncoding #5

Closed ghost closed 9 years ago

ghost commented 9 years ago

This patch adds support for valueEncodings in both the hyperlog constructor and in various hyperlog methods, the same as it works in leveldb.

With this patch you can do:

var log = hyperlog(db, { valueEncoding: 'json' })
log.append({ msg: 'whatever' })

and

log.append({ msg: 'whatever' }, { valueEncoding: 'json' })
mafintosh commented 9 years ago

nice! out in 4.1.0