rvagg/node-levelup — pull request #187 by mikeal (2013-09-10 11:35:47+00:00)
Title: Add typewise encoding option to levelup.

This ads encoding support for CouchDB/indexeDB style type sorting via bytewise.

https://github.com/deanlandolt/typewise

The reason this should go in to levelup rather than being in userland above levelup using either binary or ascii encoding is because it turns out to be pretty expensive and rather painful to encode/decode in every sublevel or equivalent byteslice portion of a levelup.

@dominictarr has also been talking about moving sublevel to use arrays and typewise sorting for which I think this patch is probably a requirement.

It should also be noted that the feature is called "typewise" as it should be implementation agnostic as to the actual encoder so that in the future we might be able to optimize the encoder/decoder for different implementations (CouchDB and IndexedDatabase would essentially be noops).